您的位置:首页 > 数据库 > MySQL

关于MYSQL的Lock wait timeout exceeded; try restarting transaction问题

2017-11-22 19:28 459 查看


Lock wait timeout exceeded; try restarting transaction

解决办法:

查看mysql数据库设置
1
2
3
4
5
6
7

mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation, @@session.tx_isolation;
+-----------------------+-----------------+------------------------+
| @@GLOBAL.tx_isolation | @@tx_isolation  | @@session.tx_isolation |
+-----------------------+-----------------+------------------------+
| REPEATABLE-READ       | REPEATABLE-READ | REPEATABLE-READ        |
+-----------------------+-----------------+------------------------+
1 row in set (0.00 sec)

修改配置
1
2
3
4
5
6
7

mysql> SET tx_isolation = 'READ-COMMITTED';
Query OK, 0 rows affected (0.00 sec)

mysql> SET GLOBAL tx_isolation = 'READ-COMMITTED';
Query OK, 0 rows affected (0.00 sec)

mysql>

即可解决问题,原理如何,暂时不清楚,待更新

参考来源:
http://mrcheng.wang/2015/12/20/mysql%E6%95%B0%E6%8D%AE%E5%BA%93%E9%94%99%E8%AF%AF%E6%B1%87%E6%80%BB/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql
相关文章推荐