- 查看当前运行的事务
select * from information_schema.innodb_trx
- 当前出现的锁
select * from information_schema.innodb_locks
- 锁等待的对应关系
select * from information_schema.innodb_lock_waits
通过第一步select * from information_schema.innodb_trx 查询,查看字段trx_mysql_thread_id的值,然后直接杀掉该id
kill ‘trx_mysql_thread_id值’
4.杀死所有休眠线程
SELECT GROUP_CONCAT(CONCAT('kill ',id) SEPARATOR '; ') AS cmd FROM information_schema.processlist
WHERE USER=‘root’
AND command=‘Sleep’
得到的休眠线程idSQL集合
复制查询出来的cmd里面的SQL语句执行就可以了