执行更新SQL报下面错误
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction
解决方法
执行下面脚本:
SELECT *
FROM information_schema.INNODB_TRX
WHERE trx_tables_locked>0 OR trx_rows_locked>0;
查询结果
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4674355407e970a5b74ded0b26a37581.png)
将trx_mysql_thread_id = 650218 手动kill掉,脚本如下:
KILL 650218;
执行成功后,再执行更新脚本就可以了