How to repair MySQL MyISAM tables?
This article describes the steps taken to repair a MyISAM table.
- Run myisamchk while the database is shut down. This tool checks, repairs and optimizes tables.
- Run the mysqlcheck tool, this can be ran while the database is in operation if needed.
- Login to the database with the root user and run the commands:
mysql> __optimize table tablename;
mysql> __analyze table tablename;
mysql> __repair table tablename;
These should clear up any issues with MyISAM tables. For more information, see the official MySQL documentation.