Table Maintenance and Crash Recovery
Database tables can get out of whack when a write to the data file is not complete. This can happen due to a variety of reasons, such as a power failure or a non-graceful shutdown of the MySQL server.
MySQL provides two mechanisms for detecting and repairing table errors: myisamchk /isamchk and mysqlcheck. It is a wise practice to perform these checks regularly. Early detection may increase your chances of recovering from errors successfully.
mysqlcheck is new with Version 3.23.38 of MySQL. The main difference between myisamchk/isamchk and mysqlcheck is that mysqlcheck enables you to check or repair tables while the server is running. myisamchk/isamchk require that the server not be running.
myisamchk and isamchk are quite similar. They provide the same functions. The only difference is that myisamchk is used on MyISAM tables, and isamchk is used on ISAM tables. mysqlcheck can be used only with MyISAM tables.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access