-- 查询运行的线程
select * from information_schema.`PROCESSLIST` where info is not null;
show full PROCESSLIST;
-- 查询所有运行的事务
select * from information_schema.innodb_trx ;
-- 查询出现的锁
select * from information_schema.innodb_locks;
-- 查询锁等待的对应关系
select * from information_schema.innodb_lock_waits ;
-- 对于死锁的mysql线程,可以直接kill
kill trx_mysql_thread_id