查询是否锁表
SHOW OPEN TABLES WHERE In_use > 0;
查看正在锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
查看等待锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
查看进程信息
SHOW PROCESSLIST;
或者
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
或者
SELECT * FROM SYS.PROCESSLIST;
KILL被锁住的表进程
KILL ID; (ID为 SHOW PROCESSLIST获得的ID标识号)