Troubleshoot MySQL
Identify and resolve issues from each step of the MySQL get started guide. Use these checks to verify your database configuration and confirm that Grafana Alloy is wired correctly. These steps do not repeat setup. If a setting is incorrect, refer back to the corresponding step in the get started article to apply the change.
What you’ll achieve
In this article, you:
- Validate MySQL user permissions and object access.
- Confirm Performance Schema and related variables.
- Verify optional consumers for query samples and wait events.
- Troubleshoot Alloy configuration for logs and metrics forwarding.
Before you begin
Make sure you can connect to your MySQL server and have sufficient privileges to run validation queries. Keep the MySQL get started article open to reapply any missing configuration.
Verify monitoring user and base privileges
Confirm that the db-o11y user exists and has the expected permissions:
SHOW GRANTS FOR 'db-o11y'@'%';
+-------------------------------------------------------------------+
| Grants for db-o11y@% |
+-------------------------------------------------------------------+
| GRANT PROCESS, REPLICATION CLIENT ON *.* TO `db-o11y`@`%` |
| GRANT SELECT, SHOW VIEW ON *.* TO `db-o11y`@`%` |
+-------------------------------------------------------------------+- If the user lacks required grants, refer to the Create a monitoring user and grant required privileges section in the get started article.
Check object-level access for detailed data
Ensure db-o11y has access to the schemas and objects you analyze.
- If a schema lacks detailed data, refer to the Grant object privileges for detailed data section in the get started article.
Confirm Performance Schema is enabled
Verify the Performance Schema state:
SHOW VARIABLES LIKE 'performance_schema';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| performance_schema | ON |
+--------------------+-------+- If
ValueisOFF, refer to the Enable Performance Schema section in the get started article.
Validate digest length variables
Verify max_digest_length:
SHOW VARIABLES LIKE 'max_digest_length';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| max_digest_length | 4096 |
+-------------------+-------+Verify performance_schema_max_digest_length:
SHOW VARIABLES LIKE 'performance_schema_max_digest_length';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| performance_schema_max_digest_length | 4096 |
+--------------------------------------+-------+- If values differ, refer to the Increase digest length limits section in the get started article.
Confirm SQL text length for samples (optional)
If you plan to disable query redaction, verify performance_schema_max_sql_text_length:
SHOW VARIABLES LIKE 'performance_schema_max_sql_text_length';
+----------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------+-------+
| performance_schema_max_sql_text_length | 4096 |
+----------------------------------------+-------+- If the value is lower than expected, refer to the Increase unredacted SQL text length limits (optional) section in the get started article.
Verify CPU consumer for query samples (optional)
Check whether the events_statements_cpu consumer is enabled:
SELECT * FROM performance_schema.setup_consumers WHERE NAME = 'events_statements_cpu';- If the consumer is disabled, re-enable it. If you rely on Alloy to auto-enable it, refer to Troubleshoot Alloy components.
- The consumer disables when the database restarts. Plan for re-enablement as needed.
Verify wait event consumers for query samples (optional)
Check whether the waits consumers are enabled:
SELECT * FROM performance_schema.setup_consumers WHERE NAME IN ('events_waits_current', 'events_waits_history');- If the consumers are disabled, re-enable them. If you rely on Alloy to auto-enable them, refer to Troubleshoot Alloy components.
Troubleshoot Alloy configuration
Validate component wiring, labels, scrape targets, and write endpoints. For guidance on exporters, components, relabeling, scrape jobs, and remote writes, refer to Troubleshoot Alloy components.
Next steps
For setup instructions, refer to Set up MySQL.



