MySQL
Connect your MySQL databases to enable Tony (Database Engineer) to analyze queries, optimize performance, and monitor database health.Supported Platforms
| Platform | Support |
|---|---|
| Self-hosted MySQL | 5.7, 8.0, 8.1+ |
| MariaDB | 10.x |
| AWS RDS MySQL | All versions |
| AWS Aurora MySQL | All versions |
| Google Cloud SQL | All MySQL versions |
| Azure Database for MySQL | Flexible Server |
Setup
1
Connect as Root
Connect to MySQL as root or admin user:
2
Create 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
Apply Changes
Flush privileges to apply changes:
6
Enable Performance Schema
Verify Performance Schema is enabled:If disabled, add to
my.cnf:7
Configure Network Access
Ensure CloudThinker can reach your database:
- Add CloudThinker IPs to security group / firewall
- For RDS: Enable public access or use VPC peering
8
Add Connection in CloudThinker
Navigate to Connections → MySQL and enter:
- Host
- Port (default: 3306)
- Database name
- Username:
cloudthinker_readonly - Password
- SSL (recommended: enabled)
Connection String Format
Required Permissions
Minimum
Recommended (Full Analysis)
Agent Capabilities
Once connected, Tony can:| Capability | Description |
|---|---|
| Query Analysis | Identify slow queries from slow query log and Performance Schema |
| Index Recommendations | Find missing indexes, identify redundant indexes |
| Performance Metrics | Monitor connections, buffer pool, query cache |
| Table Statistics | Analyze table sizes, fragmentation, engine status |
| Replication Monitoring | Check slave status, lag, errors |
Example Prompts
Connection Options
| Option | Description | Default |
|---|---|---|
| SSL | Enable SSL/TLS encryption | Enabled |
| Connection Timeout | Seconds to wait for connection | 10 |
| Read Timeout | Max time to wait for query results | 30 |
Troubleshooting
Connection refused
Connection refused
- Verify host and port are correct
- Check security group / 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)
Access denied
Access denied
- Verify username and password are correct
- Check user has correct host specification (
'user'@'%'vs'user'@'localhost') - Ensure GRANT statements were followed by FLUSH PRIVILEGES
Performance Schema disabled
Performance Schema disabled
- Check with:
SHOW VARIABLES LIKE 'performance_schema'; - Enable in
my.cnfand restart MySQL - For RDS: Modify parameter group and reboot
Missing slow query data
Missing slow query data
- Enable slow query log:
SET GLOBAL slow_query_log = 'ON'; - Set threshold:
SET GLOBAL long_query_time = 1; - For RDS: Modify parameter group
Security Best Practices
- Strong passwords - Use complex, unique passwords
- SSL encryption - Always enable SSL for connections
- Network restrictions - Limit access to CloudThinker IPs only
- Minimal permissions - Grant only SELECT, never write access
- Credential rotation - Rotate passwords every 90 days