Skip to main content
Connect your MySQL databases to enable Tony (Database Engineer) to analyze queries, optimize performance, and monitor database health.

Supported platforms

Prerequisites

  • A MySQL instance reachable from CloudThinker over the network.
  • Admin or root access to create a dedicated user and grant privileges.
  • Performance Schema enabled (default in MySQL 5.7+; verify before connecting).

Setup

1

Connect as root

Connect to MySQL as root or admin user:
2

Create a read-only user

Create the CloudThinker user:
3

Grant read permissions

Grant SELECT and monitoring privileges:
4

Grant Performance Schema access

Required for query analysis:
5

Verify Performance Schema is enabled

If disabled, add to my.cnf and restart:
6

Configure network access

Ensure CloudThinker can reach your database:
  • Add CloudThinker IPs to your security group or firewall
  • For RDS: enable public access or use VPC peering
7

Add the connection in CloudThinker

Navigate to Connections → MySQL and enter:
  • Host: your database hostname or IP
  • Port: database port (default: 3306)
  • Database: database name
  • Username: cloudthinker_readonly
  • Password: the password you set above
  • SSL: enabled (recommended)
Click Connect. CloudThinker shows a Connected status once it succeeds.

Connection details

Connection string format:

Required permissions

Minimum

Start with the minimum grants. Add performance_schema and REPLICATION CLIENT to unlock slow-query data and replication monitoring.

Agent capabilities

Once connected, Tony can:

Verify the connection

Example prompts

Troubleshooting

  • Verify host and port are correct
  • Check your security group or firewall allows CloudThinker IPs
  • For RDS: ensure “Publicly accessible” is enabled or use VPC peering
  • Confirm MySQL is listening on the correct interface (bind-address in my.cnf)
  • Verify username and password are correct
  • Check the user has the correct host specification ('user'@'%' vs 'user'@'localhost')
  • Ensure GRANT statements were followed by FLUSH PRIVILEGES
  • Check with: SHOW VARIABLES LIKE 'performance_schema';
  • Enable in my.cnf and restart MySQL
  • For RDS: modify the parameter group and reboot the instance
  • Enable slow query log: SET GLOBAL slow_query_log = 'ON';
  • Set the threshold: SET GLOBAL long_query_time = 1;
  • For RDS: modify the parameter group

Security

  • Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
  • Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
  • Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
  • Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
  • SSL required — always enable SSL to encrypt data in transit.
  • Minimal grants — grant only SELECT to the CloudThinker user; never grant write access.

Tony Agent

Database-focused optimization agent

PostgreSQL Connection

Similar setup for PostgreSQL databases