Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 | xxx.xxx.xxx.xx:54658 | 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

1 Answer 1

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

 
discard

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.