【问题标题】:Lock wait timeout exceeded; try restarting transaction MYSQL Python超过锁定等待超时;尝试重新启动事务 MYSQL Python
【发布时间】:2018-10-09 18:14:18
【问题描述】:

我有进行 SQL 更新的 Flask 应用程序:

 query = 'update tbl set x="bla" where filename=%s';
 cursor.execute(query, fileName)

此代码适用于多个文件。 突然,我在更新时开始遇到此错误(错误在每次更新调用中再次出现)。

InternalError: (1205, u'Lock wait timeout exceeded; try restarting transaction')

我看过类似的帖子 Getting "Lock wait timeout exceeded; try restarting transaction" even though I'm not using a transaction

但这并没有解决我的问题。

这是我的进程列表:

试图杀死一些睡眠进程,但没有奏效。

来自SHOW ENGINE INNODB STATUS的信息:

mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 1136, 5 row lock(s)
MySQL thread id 439228, OS thread handle 139653215057664, query id 7055088 10.66.85.134 admin updating
update tbl set vt_status=\"rescan\" where filename=\'3ec7il\'
Trx read view will not see trx with id >= 131151, sees < 131145

【问题讨论】:

    标签: python mysql


    【解决方案1】:

    试一试,终于解决了

    尝试: 连接 = getConn()

    最后: conn.close()

    【讨论】:

      猜你喜欢
      • 2015-09-27
      • 2019-03-11
      • 2019-06-02
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 2013-09-22
      • 2013-06-29
      • 2014-08-14
      相关资源
      最近更新 更多