Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when dropping or renaming a table with myisam storage engine, I realize that it's waiting for table metadata lock, however, show full processlist doesn't reveal the offending query. any idea?

| 462 | root | | mydb | Sleep   | 1162 |                                 | NULL                                                 |
| 465 | root | localhost           | mydb | Query   |    0 | NULL                            | show full processlist                                |
| 466 | root | localhost           | mydb | Query   |  125 | Waiting for table metadata lock | alter table mytable rename to mytable_junk |
share|improve this question
up vote 1 down vote accepted

If you are using MySQL 5.5, there is a bug report on it.

If fact, click here for an explanation of metadata locking. It is meant to protect tables from getting DDL executed against it while in the middle of a transaction.

What seems strange is that you are getting this on a MyISAM table.

share|improve this answer
I had the exact same problem. Our mysql is at 5.5.25a. and myisam tables somehow get stuck with a metadata lock. I tried set global lock_wait_timeout=100; but that did not work. The only way I managed to kill the lock was to restart the mysql server. – Haluk Jul 27 '12 at 21:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.