Skip to main content
The MySQL connector works with any server that speaks the MySQL protocol: self-hosted MySQL 5.7 and 8.x, Amazon RDS and Aurora MySQL, Google Cloud SQL, Azure Database for MySQL, PlanetScale, MariaDB and TiDB. JSON, spatial and binary columns come back as text or base64.

Tools

Safety

  • Read-only by default, enforced by MySQL. Every read tool runs inside START TRANSACTION READ ONLY, so the server refuses a write even from a stored function the query calls. Run Query also refuses before sending anything: comments (--, #, /* */), backslashes, a second statement, and write keywords such as INSERT, UPDATE or SELECT ... INTO OUTFILE.
  • Limits on every call. max_execution_time defaults to 15 s (up to 55 s with timeout_seconds; max_statement_time on MariaDB). Results stop at 500 rows (up to 5,000 with max_rows) and 1 MB, and Danube stops reading from the server at the cap. A cut result has truncated: true.
  • Writes are a separate tool. Execute Statement only runs on a connection stored with mode read_write, and every call returns a confirm_token first that the agent must show you and send back. Lock waits are limited to the call’s timeout, so a DDL statement that cannot get its lock fails instead of queueing every other query behind it.
  • No secrets in results. Passwords, connection strings and keys are removed from every error message and masked in results. LOAD DATA LOCAL is off.
  • Every call is audited. The audit log records who called, which tool, a SHA-256 of the SQL (never the text), the row count, the duration and the outcome.

Create a read-only user

Connect with a user that can only read. Test Connection warns when the user holds administrative or write privileges.
Repeat the GRANT SELECT, SHOW VIEW line for every database agents should see. Add REQUIRE SSL to the CREATE USER to refuse unencrypted logins. performance_schema is on by default in MySQL 8; on RDS and Aurora it is the performance_schema parameter (a reboot applies it). Without it, Slow Queries answers available: false with these steps and Table Stats leaves out the activity counters.

Connect

Open MySQL in the dashboard’s tool catalog and click Connect, or let the agent call store_credential. Fill in host, port, database, user, password and SSL mode. Mode stays Read only unless you want Execute Statement to work. SSL modes: required encrypts without checking the certificate (the default for public hosts), verify_identity also checks the certificate and host name against the system CAs or the CA certificate you paste (RDS and Cloud SQL publish theirs), preferred uses TLS when the server offers it, disabled never does. Storing a CA certificate upgrades required to verify_identity. How Danube reaches the database depends on where it lives:
Managed databases with a public endpoint (RDS or Aurora with public access, Cloud SQL with a public IP, PlanetScale, Azure) connect directly. TLS is required by default. Allow Danube’s egress addresses in the database’s firewall or security group: see Connect your production database safely.
Run Test Connection after saving. It tells you which of these failed: the credentials (auth_required), the network (connection_error, destination_blocked) or TLS (tls_error).

Example prompts

  • “Which tables in the app database are biggest, and how many rows do they have?”
  • “Find orders from the last hour with status = 'payment_failed' and group them by customer.”
  • “Why is this query slow? Explain it and suggest an index.”
  • “Is anything waiting on a lock right now, and which session holds it?”
  • “What are the ten statements that examine the most rows?”