High-yield 1Z0-908 cheat sheet for MySQL 8.0 DBAs: secure configuration, users/roles, backup/recovery, replication/HA, and performance troubleshooting commands.
Use this for last‑mile review. The exam rewards operational realism: correct defaults, safe recovery steps, and clear HA trade-offs.
1systemctl status mysqld
2mysqladmin ping
3mysql -e "SELECT VERSION(), @@hostname, @@port, @@datadir"
/etc/my.cnf, /etc/mysql/my.cnf, /etc/mysql/mysql.conf.d/mysqld.cnf@@datadir1CREATE USER 'app'@'10.%' IDENTIFIED BY 'StrongPass!';
2GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'app'@'10.%';
3FLUSH PRIVILEGES;
4SHOW GRANTS FOR 'app'@'10.%';
1CREATE ROLE 'read_only';
2GRANT SELECT ON appdb.* TO 'read_only';
3GRANT 'read_only' TO 'analyst'@'%';
4SET DEFAULT ROLE 'read_only' TO 'analyst'@'%';
1SELECT user, host, plugin FROM mysql.user;
1SHOW ENGINE INNODB STATUS;
1SHOW TABLE STATUS LIKE 'orders';
2SELECT table_schema, table_name, engine
3FROM information_schema.tables
4WHERE table_schema='appdb';
| Requirement | Likely approach |
|---|---|
| Small DB, simple restore | logical backup (mysqldump) |
| Large DB, faster restore | physical backup tools (concept-level) |
| Point-in-time recovery | full backup + binary logs |
| Lowest risk | test restores regularly, automate validation |
mysqldump1mysqldump --single-transaction --routines --triggers --events \
2 --databases appdb > appdb.sql
1mysql < appdb.sql
1SHOW VARIABLES LIKE 'log_bin';
2SHOW BINARY LOGS;
1mysqlbinlog --start-datetime="2025-12-01 00:00:00" binlog.000123 | mysql
1SHOW MASTER STATUS;
2SHOW REPLICA STATUS\\G
1SHOW VARIABLES LIKE 'slow_query_log%';
2SHOW VARIABLES LIKE 'long_query_time';
3EXPLAIN SELECT * FROM orders WHERE customer_id = 123;
1SHOW INDEX FROM orders;
High-yield reminders:
1SHOW VARIABLES LIKE 'log_error%';
| Term | Meaning |
|---|---|
| Binary log | Log of changes used for replication and point-in-time recovery. |
| GTID | Global transaction identifier for safer replication positioning. |
| Buffer pool | InnoDB memory cache for data/index pages. |
| PITR | Point-in-time recovery using backups + binary logs. |
| Replica lag | Delay between source commits and replica apply. |
| Slow query log | Log of statements exceeding a threshold; used for tuning. |