Chapter 7: MySQL Table Types 609 7.1.3 MyISAM Table Problems The file format that MySQL uses to store data has been extensively tested, but there are
always circumstances that may cause database tables to become corrupted.
7.1.3.1 Corrupted MyISAM Tables Even 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:
7 The mysqld process being killed in the middle of a write.
7 Unexpected shutdown of the computer (for example, if the computer is turned off).
7 A hardware error.
7 You are using an external program (like myisamchk) on a live table.
7 A software bug in the MySQL or MyISAM code.
Typial typical symptoms for a corrupt table is: 7 You get the error Incorrect key file for table: '...'. Try to repair it while se- lecting data from the table. 7 Queries doesn't find rows in the table or returns incomplete data. You can check if a table is ok with the command CHECK TABLE. See Section 4.5.4 [CHECK
TABLE], page 265.
You can repair a corrupted table with REPAIR TABLE. See Section 4.5.5 [REPAIR TABLE],
page 267. 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
[Crashing], page 873.
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 [Reproduceable test case], page 1030.
7.1.3.2 Clients is using or hasn't closed the table properly Each MyISAM `.MYI' file has in the header a counter that can be used to check if a table has
been closed properly.
If you get the following warning from CHECK TABLE or myisamchk:
# clients is using or hasn't closed the table properly this means that this counter has come out of sync. This doesn't mean that the table is
corrupted, but means that you should at least do a check on the table to verify that it's
okay.
The counter works as follows:

Web Hosting by Oxxus.Net

manual-908.html 
manual-91.html