How to Repair MyISAM Tables

MyISAM tables (.MYI and .MYD) can be repaired using myisamchk command.

To find list of corrupted tables

myisamchk /var/lib/mysql/DB_NAME/*.MYI >> /root/1.txt

To rapier a table

cd  /var/lib/mysql/DB_NAME/
myisamchk -r TABLE_NAME_HERE.MYI

To check and repair all tables

myisamchk --silent --force --fast --update-state /var/lib/mysql/DB_NAME/*.MYI

Look like newer version of MySQL, you need to specify just table name, no extension, for example

cd /var/lib/mysql/DB_NAME/
myisamchk -r TABLE_NAME

Back to MySQL Repair

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *