Mysql 查询是否锁表

1、查询是否锁表
show OPEN TABLES where In_use > 0;

2、查询进程
show processlist
查询到相对应的进程===然后 kill id

补充:
查看正在锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; 

查看等待锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;

 

SELECT * from information_schema.INNODB_TRX
kill trx_mysql_thread_id

 

--mysql 锁
SHOW ENGINE INNODB STATUS;
SHOW OPEN TABLES WHERE `In_use` > 0;


show processlist
show full processlist

--mysql 锁明细
SELECT * FROM information_schema.processlist;

--mysql 释放锁
--kill ID

 

posted @ 2019-03-08 21:54  cclon  阅读(53328)  评论(0编辑  收藏  举报