Repair MySQL Database

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
Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: