MySQL 数据库sql命令查询被锁的表实例演示,mysql的锁表与解锁

show open tables where in_use > 0 命令可以查询锁表。
in_use1 表示这个表同时被两个用户使用,一个正在用,一个在锁定中。

-- 为md_class表增加个写锁定
lock tables md_class write;
-- 查看锁表
show open tables where in_use > 0;
-- 表解锁
unlock tables;

查看锁表:
在这里插入图片描述
喜欢的点个赞❤吧!

猜你喜欢

转载自blog.csdn.net/qq_38161040/article/details/108734365