MySQL is a relational database management system that uses MyISAM as the default storage engine. MyISAM doesn’t support transaction, but is generally used when speed is the main concern. Each MyISAM table is stored as three files: .frm (definition file), .MYD (data file) and .MYI (index file). But sometimes, you find MyISAM table as crashed with unexpected query results. Also, you might receive errors. In such situations, it is important to delete the damaged file and restore from last backup. However, if you face any backup issues or backup is absent, you need to use MySQL Repair software as the sure database repair solution.
You might receive the below error message with MyISAM table:
“Key in wrong position at page <page number>”
Cause
You encounter the above error message if the table is crashed due to corruption. A MyISAM table gets corrupt due to these reasons:
· Hardware issues
· Errors in MyISAM or MySQL code
· Unexpected shutdown
· mysqld process is killed while writing
· Use of external program to modify a table that is simultaneously being modified by server
Solution
To resolve table corruption issues with MyISAM, you need to use these steps:
· Check the MyISAM table health using CHECK TABLE command as:
CHECK TABLE table name
You can also check the table using myisamchk or mysqlchk command line utilities with valid options.
· If CHECK TABLE reports that the table is corrupt, you should next repair the table with REPAIR TABLE command:
REPAIR TABLE table name
You can also make use of myisamchk or mysqlchk command line utilities.
· Check the table for corruption issues. If it still reports corruption, check your last backup. If it is valid enough to restore, delete the damaged table and restore from backup.
· If backup seems to be damaged or is not updated enough to give required information, you should use repair MySQL database software. These applications scan the damaged MySQL databases and repair them with original format and view. Such MySQL Repair applications are graphically rich products with impressive set of features.
Stellar Phoenix Database Recovery For MySQL is an advanced tool that repairs and restores corrupt MySQL tables. It supports MySQL 5.x. and can recover database files for both InnoDB (.ibdata, .ibd and .frm) and MyISAM (.myd, .myi and .frm) database storage engines. This MySQL Recovery software restores all database objects, including tables, relations, primary key(s), and others. It can recover databases created on Windows and Linux platforms and is compatible with Windows Vista, XP, 2003, and 2000.