1, Myisamchk
The MySQL server must be temporarily stopped using MYISAMCHK. For example, we want to overhaul the Discuz database. Perform the following actions:
# service MySQL stop (stop MySQL);
# Myisamchk-r/absolute path to the database file/*myi
# service MySQL Start
Myisamchk automatically checks and repairs index errors in the data table.
2, Mysqlcheck
With Mysqlcheck, you can perform a hot fix without stopping MySQL. The procedure is as follows:
# Mysqlcheck-r Discuz.*
# service MySQL stop (stop MySQL);
# Myisamchk-r/absolute path to the database file/*myi
# service MySQL Start
Myisamchk automatically checks and repairs index errors in the data table.
Note that, in general, do not use the-F force fix, either Myisamchk or Mysqlcheck, and the-f parameter will delete some of the error data to try to fix when it encounters a general fix that is unsuccessful. Therefore, it is not the last resort to use-F.
http://www.kxtry.com/archives/575
MySQL Data corruption repair method