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

Advertisement

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
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement