Hands-on Lab·MySQL
MySQL Integrity and Upgrade Checks
CHECK TABLE verifies structure and indexes; mysqlcheck --check-upgrade finds what an upgrade would object to. Both are cheap, and both are worth running before you need them.
Monitoring and Operations Guide 44 of 45 Intermediate
- OSUbuntu 26.04 LTS
- MySQL8.4.10-0ubuntu0.26.04.1
- Topologydb-a01 source, db-b01 and db-c01 replicas
- TimeAbout 12 min
InnoDB detects most corruption at read time via page checksums, so explicit checks matter less than they did with MyISAM. They still matter before an upgrade.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
This guide includes
Use this before and after an upgrade. This matters because the two checks answer different questions - one verifies structure and indexes as they are now, the other finds what a newer version would refuse.
- checking every table in the schema, which reports per table
- asking what an upgrade would complain about, with
--check-upgrade - seeing that the two are answering different questions
Before you start
- The
appdbdatabase.
-
Check every table in the schema
-
Ask what an upgrade would complain about