Method One, modify directly in command mode
1, Myisamchk
To fix the MySQL database, there is also a command: Mysqlcheck
Mysqlcheck-a-c-o-r–all-databases-uroot-p//This command is the best way to optimize all DB databases.
The meaning of the parameters is as follows:
-A = analyse given tables.
-c = Check table for errors
-O = Optimise table
-r = Can fix almost anything except unique keys that aren ' t unique
If it is under the win host, repair the specified table, using: Mysqlcheck-o-R database name-U root-p, in the Prompt input password box, enter the MySQL root management password, Mysqlcheck will be the database for detection and repair
Instance
The MySQL server must be temporarily stopped using MYISAMCHK. For example, we need to overhaul the Discuz database. Perform the following actions:
# service MySQL stop (stop MySQL);
# myisamchk-r/Database file absolute path/*myi
# service MySQL Start
Myisamchk automatically checks for and repairs index errors in the datasheet.
2, Mysqlcheck
With Mysqlcheck you do not need to stop MySQL for hot fixes. The procedure is as follows: # Mysqlcheck-r discuz.*
Note that, whether it is Myisamchk or mysqlcheck, do not normally use the-F force fix, the-f parameter deletes part of the error data to try to fix when the general fix fails to succeed
Method two, using phpMyAdmin to quickly modify the corrupted MySQL
1, Login phpMyAdmin, enter the phpMyAdmin data list page;
2, select a data table before the box;
3, below the page "selected item" Drop-down Select "Fix table";