Repair a corrupt or invalid MySQL table

This article will go over the steps of repairing a corrupt or invalid MySQL table. Common errors you may see are:

  1. Log into the MySQL server via SSH
  2. At the shell prompt type: mysqlcheck --auto-repair [database name]
  3. The utility will automatically check and repair all tables in the database specified and report its results

If the above utility does not work you can try the following at the shell prompt (Linux only):

cd /var/lib/mysql/[database name]
myisamchk -r *.MYI