Repairing MyISAM table damaged due to power outages
August 24th 2015 Posted at Databases
Comments Off on Repairing MyISAM table damaged due to power outages
Of the various types of database tables in MySQL database, the MyISAM tables are the default tables. These tables are very secure as it facilitates table level locking, which locks the table while performing any update operations. However, at times you encounter a situation in which the index file of the MyISAM table gets corrupt due various reasons. Such reasons can occur because of virus infections, power surges, unplanned system shutdown, etc. MySQL provides several methods to detect and repair MySQL table corruption failing which services of professional MySQL recovery tools should be taken to repair MySQL database.
Taking a practical situation into account in which you are working on a MySQL table during which there is a power cut. You open the MySQL table once the power is restored and executed a query to retrieve some records. However, the query failed and the following error is displayed:
“MySQL error code 132 = Old database file”
Cause:
The root cause of this problem is that the table definitions have damaged due to the power outage. Because of this, you are unable to run the query.
Resolution:
In such cases, you should check the MySQL table for corruption and, then, if errors are found then repair them. To do this, you can perform the following methods:
CHECK TABLE: To use this method to check the table, you need not exit the server. There are many useful parameters to use this command such as QUICK, FAST, CHANGED, etc. The syntax of this command is:
CHECK TABLE tablename[,tablename2…] [option][,option2…]
REPAIR TABLE: After checking the table for errors, you should repair the MySQL table using REPAIR TABLE command, which too runs without exiting the server. It has got different switches to choose from like EXTENDED, USE_FRM, etc. Its syntax is:
REPAIR TABLE tablename[,tablename1…] [options]
If the error is persisting when you regenerate the query to be executed, it means that the MySQL table is severely damaged. This situation can be resolved by repairing MySQL table using a third-party MySQL repair software. The biggest advantage of such MySQL recovery tools is that these tools use highly sophisticated scanning algorithms that do not modify the existing database while scanning.
The most recommended MySQL repair software, which is designed to repair MySQL databases created in MySQL 3.x, 4.x, 5.x, and 6.x versions, is Stellar Phoenix Database Recovery for MySQL. Capable of restoring various database objects such as tables, views, primary keys, etc, this MySQL recovery tool recovers MySQL files of all kinds including .ibdata, .ibd, .frm, .myd, and .myi. It is compatible with Windows 7, Vista, Server 2003, XP, and 2000.
My name is Mark Willium, I have done Ph.D in computer science and currently doing research on how to recover and repair corrupted MySQL database. You can have more information about about MySQL recovery by visiting my blog http://database-recovery-software.blogspot.com/
Both comments and pings are currently closed.