解决 项目中 Lock wait timeout exceeded; try restarting transaction; nested exception is java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction 错误
原因 是因为MySQL的事务产生了死锁 。解决办法(navicat 客户端执行即可):
-- 查询对应的线程
select trx_mysql_thread_id from information_schema.innodb_trx;
-- kill 线程的id
kill trx_mysql_thread_id;
原文链接:https://blog.csdn.net/qq_27292113/article/details/77717621