Recovering A Corrupt Innodb Table In Mysql

By:


The MySQL database is one of the most used database engines in the world. The reasons behind this are apart from being an open sourced database its scalability, flexibility, high availability, ability to carry out robust transactions, and so on. However, sometimes a MySQL data can get corrupt and inaccessible. At times, when you try to open a database table, it fails to do so. This may happen if the database that you are trying to access is corrupt. In such situations, you should try to take appropriate measures to Repair MySQL Database. However, if you are unable to do so, then you should consider using a third-party MySQL repair tool to recover MySQL database.

Consider a scenario wherein you try to open an InnoDB table but are unable to do so. An error message is displayed, that is:

#1051 - Unknown table table_name

Cause:
The reason for this error message is that the InnoDB table may have got corrupt because of various reasons such as virus infection, human error, abrupt system shutdown when the database is open, etc. When an InnoDB table fails, the entire database will not start. MySQL will exit and the entire database will be offline.

Resolution:
To resolve this error and to access the database again, you need to repair MySQL database by performing the following steps:
Add the following line to the /etc/my.cnf configuration file:
[mysqld]
innodb_force_recovery = 4
Restart MySQL. The database will start but with innodb_force_recovery all the Insert and Update operations will be ignored.
Dump all the tables.
Exit database and remove the data directory.
Run mysql_install_db to create MySQL default tables.
Remove the innodb_force_recovery line from the /etc/my.cnf configuration file and restart the database.
Restore the backup.

However, if you are not able to resolve the issue even after performing the aforementioned method then you should use a third-party MySQL recovery tool to MySQL Repair. Such read-only tools are able to recover MySQL database using fast yet sophisticated scanning algorithms.

MySQL Database Recovery is a MySQL recovery tool that enables you to repair MySQL database. It is able to repair MySQL databases built in MyISAM and InnoDB database engines. This MySQL repair tool is able to recover MySQL database components such as tables, views, etc. It can repair various MySQL files such as .ibdata, .ibd, .frm, .myd, .myi, and .frm created in MySQL 4.x or 5.x versions. It is compatible with Windows 7, Vista, Server 2003, XP, and 2000.


About the Author:
Naveen Kadian is a self employed Internet entrepreneur and product reviewer Stellar Phoenix Database Recovery For MySQL is the premier Recover MySQL tool that can instantly repair and restore corrupt MySQL databases. It supports InnoDB (.ibdata, .ibd and .frm) and MyISAM (.myd, .myi and .frm) files.



Article Originally Published On: http://www.articlesnatch.com


|

Loading...
Related....
Videos...

Recent Data-Recovery Articles

Comments

Still can't find what you are looking for? Search for it!

Loading

Copyright 2005-2011 ArticleSnatch, LLC - All Rights Reserved.
Privacy Policy | Terms of Service.