Repairing corrupted mysql database

Please follow the following steps to repair the database:Login to server with root access

Stop mysql using following command

/etc/init.d/mysql stop

Run following command to check all teh tables in teh database

/usr/bin/myisamchk /var/lib/mysql/databasename/*.MYI

Run following command to repair all teh tables in the database

/usr/bin/myisamchk -r /var/lib/mysql/databasename/*.MYI

Then recheck again using following command

/usr/bin/myisamchk /var/lib/mysql/databasename/*.MYI

Restrart MySql service using following command

/etc/init.d/mysql restart