MyISAM
Tables
MyISAM
Table Problems
MyISAM
Tables
MyISAM
TablesEven if the MyISAM table format is very reliable (all changes to a table is written before the SQL statements returns) , you can still get corrupted tables if some of the following things happens:
mysqld
process being killed in the middle of a write.
Typial typical symptoms for a corrupt table is:
Incorrect key file for table: '...'. Try to repair it
while selecting data from the table.
You can check if a table is ok with the command CHECK
TABLE
. See section 4.4.4 CHECK TABLE
Syntax.
You can repair a corrupted table with REPAIR TABLE
. See section 4.4.5 REPAIR TABLE
Syntax.
You can also repair a table, when mysqld
is not running with
the myisamchk
command. myisamchk syntax
.
If your tables get corrupted a lot you should try to find the reason for this! See section A.4.1 What To Do If MySQL Keeps Crashing.
In this case the most important thing to know is if the table got
corrupted if the mysqld
died (one can easily verify this by
checking if there is a recent row restarted mysqld
in the mysqld
error file). If this isn't the case, then you should try to make a test
case of this. See section E.1.6 Making a Test Case If You Experience Table Corruption.