欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarti

程序员文章站 2022-05-23 21:11:42
...

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

前言:朋友咨询我说执行简单的update语句失效,症状如下:
mysql> update order_info set province_id=15 ,city_id= 1667 where order_from=10 and order_out_sn='1407261241xxxx';
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
mysql>

QQ远程过去,开始check
1,
查看数据库的隔离级别:

mysql> select @@tx_isolation;
+-----------------+
| @@tx_isolation |
+-----------------+
| REPEATABLE-READ |
+-----------------+
1 row in set (0.00 sec)

mysql>


2,
去查看先当前库的线程情况:

mysql> show full processlist;

+----------+-----------------+-------------------+-----------------+-------------+---------+-------------------------+-----------------------+

| Id | User | Host | db | Command | Time | State | Info |

+----------+-----------------+-------------------+-----------------+-------------+---------+-------------------------+-----------------------+

| 1 | event_scheduler | localhost | NULL | Daemon | 9635385 | Waiting on empty queue | NULL |