MySQL DBA Checklist
MySQL troubleshooting should start with the server identity and a small set of read-only checks. The MySQL manual documents mysql as the command-line client for interactive and noninteractive SQL use. This checklist turns that into a repeatable DBA workflow for developers, admins and incident handoffs.
Connection identity
mysql --version
mysql -e "select version(), current_user(), database();"
mysql -e "show variables like 'hostname';"
mysql -e "show variables like 'port';"
mysql -e "show variables like 'datadir';"
mysql -e "show variables like 'socket';"Service and availability
mysqladmin ping
mysqladmin status
mysqladmin variables | grep -E 'version|datadir|socket|port'
systemctl status mysql --no-pager
systemctl status mysqld --no-pager
journalctl -u mysql -n 120 --no-pagerSessions and active queries
Start with process visibility before changing indexes or configuration. Save long-running query text with timestamps and application host information when possible.
mysql -e "show full processlist;"
mysql -e "select id, user, host, db, command, time, state, left(info, 160) as query from information_schema.processlist where command <> 'Sleep' order by time desc;"
mysql -e "show global status like 'Threads_connected';"
mysql -e "show global status like 'Threads_running';"InnoDB and storage signals
mysql -e "show engine innodb status\\G"
mysql -e "select table_schema, round(sum(data_length + index_length) / 1024 / 1024, 1) as mb from information_schema.tables group by table_schema order by mb desc;"
mysql -e "select table_schema, table_name, round((data_length + index_length) / 1024 / 1024, 1) as mb from information_schema.tables order by mb desc limit 20;"
df -h
du -sh /var/lib/mysql 2>/dev/nullSlow query and configuration checks
| Question | Command | Meaning |
|---|---|---|
| Is slow logging enabled? | show variables like 'slow_query_log'; | Without it, you may be guessing from application symptoms. |
| Where are slow logs? | show variables like 'slow_query_log_file'; | The DBA can inspect slow query samples outside the app. |
| What is the threshold? | show variables like 'long_query_time'; | A threshold too high hides useful signals. |
| Which config loaded? | mysql --help | grep -A1 'Default options' | Runtime config may not be the file you edited. |
| Are tables huge? | information_schema.tables | Large tables change index and backup decisions. |
Backup and restore readiness
Use logical backups for repeatable checks, but do restore tests on a safe target. Do not overwrite a production schema to prove a backup.
mysqldump --single-transaction --routines --triggers --events my_database > my_database.sql
mysql --database=my_database_restore_test < my_database.sql
mysql -e "select table_schema, count(*) from information_schema.tables where table_schema in ('my_database','my_database_restore_test') group by table_schema;"Incident evidence bundle
date -Is
hostname
mysql --version
mysql -e "select version(), current_user(), database();"
mysqladmin status
mysql -e "show global status like 'Threads_running';"
mysql -e "show full processlist;"A useful MySQL handoff proves identity, service state, active sessions, InnoDB/storage signals, slow query visibility and backup readiness before recommending tuning.
Related: PostgreSQL DBA Checklist, Redis Debugging Checklist, SQL Cleanup.