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

posted @ 2016-10-14 17:00  梦见舟  阅读(545)  评论(0编辑  收藏  举报