Quickly repair damaged mysql database
1, myisamchk
Use myisamchk to temporarily stop the MySQL server.For example, we want to overhaul the discuz database.Do the following:
# service mysql stop (stop MySQL);
# myisamchk-r/The absolute path of the database file/*MYI
# service mysql start
myisamchk will automatically check and repair The index in the data table is wrong.
2, mysqlcheck
Using mysqlcheck does not need to stop MySQL, you can perform hot repair.The steps are as follows:
# mysqlcheck-r discuz.*
# service mysql stop (stop MySQL);
# myisamchk-r/absolute path of database file/*MYI
# service mysql start
myisamchk will automatically check and repair index errors in the data table.
Attention, whether it is myisamchk or mysqlcheck, generally do not use-f to force a repair.The-f parameter will delete part of the error data in an attempt to repair when the normal repair fails.Therefore, do not use-f as a last resort.
0 Comments