O'Reilly logo

Managing & Using MySQL, 2nd Edition by Hugh E. Williams, Randy Yarger, George Reese, Tim King

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required