mysql 查詢值,如何查詢mysql中是否表被鎖?
1、查詢是否鎖表
show OPEN TABLES where In_use > 0;
2、查詢進(jìn)程
show processlist
查詢到相對應(yīng)的進(jìn)程===然后 kill id
補充:
查看正在鎖的事務(wù)
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
查看等待鎖的事務(wù)
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;