Friday, January 8, 2010

Repairing Corrupt MySQL InnoDB table

MySQL InnoDB table corruption or damage results in inaccessibility of all its stored records. There can be different causes for corruption in table including improper system shutdown, fatal virus hit, application malfunction, and human errors. However, the most common way to identify that your database has been corrupted is when you view an error message, instead of the records. Restoration of data from an updated backup allows you to overcome such error messages. But restoration process can only be performed in case the user has maintained a valid backup. If you have not created a backup or the backup is corrupted, then you will need to repair the corrupt database table using an advanced third-party Repair MySQL Database tool.

Consider a practical case, where you receive the below error message when you attempt to access the records saved in the MySQL table (employee):

“#1051 - Unknown table 'employee'”

After the above error message appears, the data stored in the “employee” table gets inaccessible. Furthermore, the error message pops up whenever you open the table.

Reason:

The main reason for the occurrence of the above error message is corruption of employee table.

Resolution:

The resolution for the above error message can be achieved by following steps:

1.The first steps is to add “innodb_force_recovery=4” to /etc/my.cnf configuration file.
2.Restart MySQL and dump the employee table.
3.Shutdown your database and erase the data directory.
4.Create default tables using mysql_install_db.
5.Remove “innodb_force_recovery=4” from /etc/my.cnf configuration file.
6.Restore the data from a valid backup.

The above steps fail to resolve your issue if you have not created a backup. In such situations, you will need to search for effective MySQL Database Repair tool that can repair the corrupt table. Such MySQL Repair tools are non-destructive in nature and perform repair without modifying the original data. The repair utilities employ intensive scanning methods to systematically repair the database and restore it on the user-specified destination. These tools can easily be used by both non-technical users.

Check These Related Articles :-
http://www.articlealley.com/article_1104081_11.html

http://www.articlealley.com/article_1094363_11.html

No comments:

Post a Comment