Symptoms of damage
A typical symptom of a damaged table is as follows:
1. When selecting data from a table, you get the following error: Incorrect key file for table: ' ... '. Try to repair it
2. The query cannot find rows in the table or return incomplete data.
3. Error:table ' P ' is marked as crashed and should to be repaired.
4, open the table failed: Can ' t open file: ' xxx. Myi ' (errno:145).
MySQL Table Damage Repair
The MyISAM table can be repaired using the following steps:
1, use Reapair table or Myisamchk to repair.
Use phpMyAdmin to repair the table with sadness, prompting "marked as crashed and last (automatic) repair failed". After checking a related information, I learned that using the Myisamchk tool can repair the table.
Myisamchk.exe in the Mysqlbin directory, if the directory is not available please download the attached Myisamchk.rar of this article.
To check for errors in a table, you only need to run Myisamchk (in the MySQL bin directory) and provide the location and table name of the file, or the index file name of the table:
The code is as follows |
Copy Code |
Myisamchk/usr/local/mysql/var/dbname/tblname Myisamchk/usr/local/mysql/var/dbname/tblname.myi |
All two of the above commands can perform a check on the specified table. To check all tables in the database, you can use the wildcard character
Repair steps:
1 Stop the MySQL service before fixing it.
2 Open the command line, and then go to the MySQL/bin directory.
3 Execute MYISAMCHK--recover database path/*. Myi. Note: Do not follow the prompts behind;
However, it should be noted that the MYISAMCHK tools are not omnipotent. The tool is useless for some extreme damage, such as a corrupted form description file. This database administrator still needs the best database day-to-day backup work
Using phpMyAdmin to modify
Find the database of the problematic table in phpMyAdmin, then go to the table where the problem is found, and then click on the repair table below to quickly implement the problem.