Wednesday, May 30, 2012

Repair all database in mysql


Repair all database in mysql



Following command will repair your all databases on server.

myisamchk -r /var/lib/mysql/*/*.MYI

/etc/rc.d/init.d/mysql restart



Following command will show if you need to repair your database or not

myisamchk –check /var/lib/mysql/*/*.MYI

Then try ‘safe-recover’ first:

myisamchk –safe-recover /var/lib/mysql/*/*.MYI

OR

myisamchk –recover /var/lib/mysql/*/*.MYI

Forceful

myisamchk –safe-recover –extend-check –force /var/lib/mysql/*/*.MYI

OR

myisamchk –recover –extend-check –force /var/lib/mysql/*/*.MYI

No comments:

Post a Comment