MySQL Corrupt But Won’t Repair

I had a problem this week installing a second copy of WordPress on my server from which to run a personal blog.  The installation kept failing to access the database, pointing to a permissions problem.  Running a GRANT statement to give the correct privileges to the new database gave no error but on checking the mysql.users table I discovered that no changes were actually being written to the permissions!

check table user

returned an error:

Table ‘.mysql.user’ is marked as crashed and should be repaired.

repair table user

returned

Table is already up to date

and the circle continued……..

So I had a corrupt user table which wouldn’t let me repair it.  However, there is another repair utility which is used on upgraded tables from MySQL 4.x which will repair tables in these circumstances.  To use it, just navigate to your MySQL data directory and run:

myisamchk -r *.MYI

This will check and repair all tables in the directory.  Of course you can repair just a single table by replacing * with the table name.

0 Responses to “MySQL Corrupt But Won’t Repair”


  1. No Comments

Leave a Reply


Enter this code