有没有办法检测 MySQL 中锁定的表?我的意思是表被锁定LOCK TABLE table WRITE/READ
命令。
(Note that readers interested in detecting named locks acquired with GET_LOCK
should read Show all current locks from get_lock https://stackoverflow.com/q/11034504/1709587 instead.)
Use SHOW OPEN TABLES
:
http://dev.mysql.com/doc/refman/5.1/en/show-open-tables.html http://dev.mysql.com/doc/refman/5.1/en/show-open-tables.html
你可以做这样的事情
SHOW OPEN TABLES WHERE `Table` LIKE '%[TABLE_NAME]%' AND `Database` LIKE '[DBNAME]' AND In_use > 0;
检查数据库中任何锁定的表。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)