Repair all database in mysql

robocap

Well-Known Member
Nov 6, 2006
67
0
156
Hello
we have whm in my server
in whm is one part to name
Repair Mysql Database


this is only for one database
how may i repaired all database in my server?

Thanks
 

psrsathish

Active Member
Jul 19, 2006
31
0
156
India.
Hi,

Its not possible to repair all the databases in one time. You need to repair each and every database separately.
 

Nhojohl

Well-Known Member
Nov 28, 2006
101
0
166
mysqlcheck -Aao --auto-repair -u root --password="ROOTPASS"

use the quotes also :P
 

koolcards

Well-Known Member
Oct 8, 2003
146
0
166
Tampa, Fl
/etc/rc.d/init.d/mysql stop

2) Repair all SQL databases:
myisamchk -r /var/lib/mysql/*/*.MYI

3) Start mysql again:
/etc/rc.d/init.d/mysql start
The database server needs to be running to do any of these checks. Log in as 'root' via SSH and:

Shows you if any need repair:
myisamchk --check /var/lib/mysql/*/*.MYI

Then try 'safe-recover' first:
myisamchk --safe-recover /var/lib/mysql/*/*.MYI

and, if neither that nor this works:
myisamchk --recover /var/lib/mysql/*/*.MYI

Then use the 'force' flag:
myisamchk --safe-recover --extend-check --force /var/lib/mysql/*/*.MYI

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