mysql 查询锁,解锁语句

一:锁表:

锁定数据表,避免在备份过程中,表被更新

mysql>LOCK TABLES tbl_name READ;

为表增加一个写锁定:

mysql>LOCK TABLES tbl_name WRITE;

二:查询mysql 哪些表正在被锁状态

 show OPEN TABLES where In_use > 0;

三:mysql解锁

第一种

show processlist;

找到锁进程,kill id ;

第二种

mysql>UNLOCK TABLES;

原文地址:https://www.cnblogs.com/Alight/p/4193439.html