检测锁定表(由LOCK TABLE锁定)
问题描述:
有没有一种方法可以检测MySQL中的锁定表?我的意思是被LOCK TABLE table WRITE/READ
命令锁定的表.
Is there a way to detect locked tables in MySQL? I mean tables locked by the LOCK TABLE table WRITE/READ
command.
(请注意,有兴趣检测用GET_LOCK
获取的命名锁的读者,请阅读显示所有当前的锁都来自get_lock .)
(Note that readers interested in detecting named locks acquired with GET_LOCK
should read Show all current locks from get_lock instead.)
答
SHOW OPEN TABLES
以显示每个表的状态及其锁定.
SHOW OPEN TABLES
to show each table status and its lock.
对于命名锁,请显示get_lock中所有当前的锁