HostOnNet Blog

Repair MySQL MyISAM Database with myisamchk

Looking for Linux Server Admin or WordPress Expert? We can help.

myisamchk is a command line tool to repair MySQL MyISAM database. You need to run it a user root.

To repair all MyISAM tables in a database, run

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

Example

[root@localhost ~]# myisamchk --recover /var/lib/mysql/w3blogs/wp_blogs
- recovering (with sort) MyISAM-table '/var/lib/mysql/w3blogs/wp_blogs'
Data records: 199
- Fixing index 1
- Fixing index 2
- Fixing index 3
[root@localhost ~]#

This is useful during crash recovery when you have many MySQL database tables require repair.

Posted in MySQL

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.