mysql 表被锁处理方案

1. 查询锁表信息

当前运行的所有事务

select * from information_schema.innodb_trx 

当前出现的锁

select * from information_schema.innodb_locks 

锁等待的对应关系

select * from information_schema.innodb_lock_waits  

2. kill 线程

通过 select * from information_schema.innodb_trx 查询 trx_mysql_thread_id
然后执行 kill 线程ID

原文地址:https://www.cnblogs.com/mengjianzhou/p/5961170.html