Wednesday, January 27, 2010

Three ways to Repair MyISAM tables

Corruption in MyISAM tables is a nightmare for almost every Database Administrator (DBA). These tables are one of the most important components to save personal and professional data, and corruption of these tables primarily result into inaccessibility of all that data. In such cases, a valid database backup allows you to restore the data and access the table records. While the backup file is mostly saved on a different storage media, the possibilities of its corruption still exist. In such cases, you will need to perform Repair MySQL Database.

Below are the few error messages that enable you to identify that your MyISAM table (employee) is corrupt:

“employee.frm is locked against change”
“Can't find file employee.MYI (Errcode: nnn)”
“Got error employee from table handler”

The data stored in the employee table becomes inaccessible after the above error message pops up. In addition, you receive any of the above error message each time you attempt to access the table.


Few main reasons for the employee table corruption are improper MySQL Server shutdown, virus infection, file system damage, and human errors.


To resolve the above error messages and access the employee table records, you will need to follow the below measures:

You can use an in-built tool “myisamchk” to check and repair the employee table. The command-line tool scans the database components, identifies the exact cause of corruption, and repair the tables.

You can use various SQL commands to repair the employee table. These commands are CHECK TABLE, REPAIR TABLE, and OPTIMIZE TABLE.

The probabilities of employee table not being repaired by any of the above steps is very less, but still exists. Such cases occur when the table is badly corrupted. To repair the table in such situations, you will need to use an advanced third-party Repair MySQL tool.

These MySQL Repair tools provide complete repair of MyISAM tables by repairing them using advanced repairing algorithms. Such tools are completely read-only in nature and perform repair without modifying the original file. Moreover, these tools are easily understandable without any prior technical knowledge.

1 comment:

  1. SQL databases can be repaired due to sql database repair. The utility restores mdf files after power failures, viruses, malicious software. It can show the results of repairing as a table list. Program works under Windows 98 and higher.