我有一个Flask应用程序,它可以更新SQL:
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
最佳答案
试着去解决它
尝试:
Conn=getConn()
最后:
连接关闭()