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

来源:互联网 发布:重庆时时计划软件 编辑:程序博客网 时间:2024/05/17 03:42

Lock wait timeout exceeded; try restarting transaction

解决办法:

  1. 查看mysql数据库设置

    1234567
        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)
  2. 修改配置

    1234567
    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/

阅读全文
0 0
原创粉丝点击