Preparing MySQL for monitoring
Published 18 February 2025
Setting up a MySQL User
- CREATE USER 'redgatemonitor'@'<host>' IDENTIFIED BY '<password>';
- GRANT SELECT ON *.* TO redgatemonitor;
- GRANT PROCESS ON *.* TO redgatemonitor;
- GRANT CREATE TEMPORARY TABLES ON *.* TO redgatemonitor;
Configuring MySQL Instances
You will need to connect to the MySQL instance and create a database which Redgate Monitor can use to create temporary tables within:
- CREATE DATABASE IF NOT EXISTS redgatemonitor_db;
Configuring MySQL Instances to track statement execution CPU time
Please be aware that this section does not apply when running on RDS. CPU time in Top Queries section will be shown as zero on RDS as there is no option to enable events_statements_cpu.
Make sure that events_statements_cpu is enabled by running following command
- SELECT *
- FROM performance_schema.setup_consumers
- WHERE NAME LIKE '%statements%';
If the ENABLED column is set to NO, please run following:
- UPDATE performance_schema.setup_consumers
- SET ENABLED = 'YES'
- WHERE NAME = 'events_statements_cpu';