‘table_name .frm is locked against change’ MySQL Error and Recovery

Each MySQL table is represented by an .frm file onis used with options, like QUICK, FAST, MEDIUM etc.:
disk, no matter which storage engine you use. An .frmCHECK TABLE tablename [options]
file describes the table definition and possesses theIf you are using MyISAM, you can alternatively run
same name as of table. The corruption of .frm file‘mysqlcheck’ or ‘myisamchk’
leads to table inconsistencies. It could happen due tocommand-line utilities.
improper locking of table, DLL file errors, system faults,- If database check reports table corruption, you need
disk issues, virus attack, unexpected shutdown etc.to repair it next. Before repairing, make sure that about
You need to use your recent data backup to restoretwice as much disk space as of affected table is
data in such situations. However, if data backup existsavailable. Use REPAIR TABLE command with options,
in invalid state, or is not available at all, you need to uselike QUICK and EXTENDED. The syntax is:
MySQL Database Recovery applications that prove toREPAIR TABLE tablename [options]
be safe tools for repairing damaged MySQLFor MyISAM tables, use of ‘mysqlcheck’ or
databases.‘myisamchk’ is also applicable.
You might receive the following error message with- If above measures fail to fix table corruption, you
MySQL database table(s):need to delete the damaged table if valid backup
“<table_name>.frm is locked againstexists.
change”- If no backup is available, or you find backup in invalid
Causestate, make use of commercial MySQL Recovery
The primary cause for the occurrence of above errorapplications to repair and restore damaged MySQL
message is corruption of .frm file.tables. Such software are complete database repair
Solutionproducts that scan corrupted databases using
In order to correct such corruption errors, you requirepowerful scanning algorithms. These MySQL
following these steps:Database Recovery tools provide automated
- You need to first ensure about table corruption. Torecovery options together with interactive interface
perform this check, use CHECK TABLE commandand read-only design.
while server is running. It follows the below syntax and