:: DEVELOPER ZONE
Even though the MyISAM table format is very
reliable (all changes to a table made by an SQL statement are
written before the statement returns), you can still get corrupted
tables if some of the following things happen:
The mysqld process is killed in the middle of a write.
Unexpected computer shutdown occurs (for example, the computer is turned off).
Hardware errors.
You are using an external program (such as myisamchk) on a table that is being modified by the server at the same time.
A software bug in the MySQL or MyISAM code.
Typical symptoms for a corrupt table are:
You get the following error while selecting data from the table:
Incorrect key file for table: '...'. Try to repair it
Queries don't find rows in the table or return incomplete data.
You can check whether a MyISAM table is okay
with the CHECK TABLE statement. You can repair a
corrupted MyISAM table with REPAIR
TABLE. When mysqld is not running, you
can also check or repair a table with the
myisamchk command. See
Section 13.5.2.3, “CHECK TABLE Syntax”, Section 13.5.2.6, “REPAIR TABLE Syntax”, and
Section 5.8.3.1, “myisamchk Invocation Syntax”.
If your tables become corrupted frequently, you should try to
determine why this is happening. The most important thing to know
is whether the table became corrupted as a result of a server
crash. You can verify this easily by looking for a recent
restarted mysqld message in the error log. If
there is such a message, it is likely that table corruption is a
result of the server dying. Otherwise, corruption may have occurred
during normal operation, which is a bug. You should try to create a
reproducible test case that demonstrates the problem. See
Section A.4.2, “What to Do If MySQL Keeps Crashing” and
Section E.1.6, “Making a Test Case If You Experience Table Corruption”.
© 1995-2005 MySQL AB. All rights reserved.

User Comments
Warning: query failed: Unknown column 'user.firstname' in 'field list' in /data0/sites/live/web-main/lib/mysql-cxn.php on line 69
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data0/sites/live/web-main/lib/docbook.php on line 245
Add your own comment.