Can't execute the query because you have a conflicting read lock

mysql> create table t (id int(10) );

ERROR 1223 (HY000): Can't execute the query because you have a conflicting read lock



mysql> select id,user,host,command,time,state from information_schema.processlist;
+----+---------+---------------------+-------------+------+------------------------------------------------------------------+
| id | user    | host                   | command     | time | state                                                            |
+----+---------+---------------------+-------------+------+------------------------------------------------------------------+
|  9 | root    | localhost            | Sleep        |  516 |                                                                  |
| 17 | root    | localhost           | Query       |  952 | Waiting for global read lock                                     |
| 22 | root    | localhost           | Query       |    0 | executing                                                        |
+----+---------+---------------------+-------------+------+------------------------------------------------------------------+
3 rows in set (0.00 sec)


global read lock  是怎么产生的?

那个线程产生的呢?


一般global read lock 有 flush table with read lock; 产生。因此只要UNLOCK TABLES 就可以了。

要定位那个thread 持有这个锁,可能需要借助gdb了。



你可能感兴趣的:(MySQL)