MySQL database sql command query the locked table instance demonstration, mysql lock table and unlock

show open tables where in_use > 0Command can query the lock table.
In_use is 1 means that this table is used by two users at the same time, one is in use and one is locked.

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

Check the lock table:
Insert picture description here
Like the one you like ❤!

Guess you like

Origin blog.csdn.net/qq_38161040/article/details/108734365