Some great Grafana MySQL dashboard options:
Option 1: Official MySQL Dashboard (Recommended)
Dashboard ID: 7362 — MySQL Overview by percona
Import it directly in Grafana:
Dashboards → Import → Enter ID: 7362 → Load
Covers: QPS, connections, InnoDB buffer pool, slow queries, replication lag.
Option 2: Popular Community Dashboards
| Dashboard ID | Name | Best For |
|---|---|---|
7362 | MySQL Overview (Percona) | General purpose |
6239 | MySQL InnoDB Metrics | Deep InnoDB tuning |
14057 | MySQL Exporter Quickstart | mysqld_exporter default |
11323 | MySQL Replication | Master/slave monitoring |
Setup Requirements
1. Install mysqld_exporter
# Downloadwget https://github.com/prometheus/mysqld_exporter/releases/latest/download/mysqld_exporter-*.linux-amd64.tar.gz# Create MySQL user for exportermysql -u root -p
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'yourpassword' WITH MAX_USER_CONNECTIONS 3;GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost';FLUSH PRIVILEGES;
2. Configure exporter credentials
# /etc/.my.cnf[client]user=exporterpassword=yourpassword
3. Run the exporter
./mysqld_exporter --config.my-cnf=/etc/.my.cnf# Default port: 9104
4. Add to Prometheus scrape config
# prometheus.ymlscrape_configs: - job_name: 'mysql' static_configs: - targets: ['localhost:9104']
Key Metrics to Monitor
# Queries per secondrate(mysql_global_status_queries[5m])# Active connectionsmysql_global_status_threads_connected# Connection usage %100 * mysql_global_status_threads_connected / mysql_global_variables_max_connections# Slow queries raterate(mysql_global_status_slow_queries[5m])# InnoDB buffer pool hit rate(1 - rate(mysql_global_status_innodb_buffer_pool_reads[5m]) / rate(mysql_global_status_innodb_buffer_pool_read_requests[5m])) * 100# Replication lag (if replica)mysql_slave_status_seconds_behind_master
What to Alert On
| Metric | Threshold | Severity |
|---|---|---|
| Connection usage | > 80% | Warning |
| Connection usage | > 95% | Critical |
| Replication lag | > 30s | Warning |
| Slow queries rate | > 10/s | Warning |
| Buffer pool hit rate | < 95% | Warning |
| Uptime (restarted) | < 300s | Critical |
Quick start: Just import dashboard 7362 — it works out of the box with mysqld_exporter defaults and covers 90% of what you need.