Guys,
I usually use following command to repair all the tables of the databases of a user.
=========
[root@server /var/lib/mysql]#for i in `ll |grep bigchakr|awk '{print $9}' |cut -d/ -f1`; do for j in `mysql -e "use $i; show tables;"|grep -v -`; do mysql -e "use $i; repair table $j;"; done done;
=========
User : bigchakr, please replace this user. It'll repair all the tables of all the DB of that user.
You can use myisamchk command to repair the DB. Here is the comamnd :
========
[root@server /var/lib/mysql]# myisamchk -r /var/lib/mysql/bigchakr_content/*.MYI
========
Note : bigchakr_content is the name of the DB. You can use following command.
========
[root@server /var/lib/mysql]# for i in `ll |grep bigchakr|awk '{print $9}'`; do myisamchk -r $i/*.MYI ; done
========
I don't prefer myisamchk since sometime it doesn't give good results.
Try. :)
Thursday, 16 September 2010
How to repair mysql database or tables of the database?
Posted on 05:03 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment