【发布时间】: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')
但这并没有解决我的问题。
试图杀死一些睡眠进程,但没有奏效。
来自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
【问题讨论】: