[root@wx03 ~]# cat a3.sh
mysql -uroot -p1234567<<eof
use scan;
FLUSH TABLES WITH READ LOCK;
system sleep 200;
exit;
eof
mysql> use scan;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from t1;
+-----+
| c1 |
+-----+
| 100 |
+-----+
1 row in set (0.00 sec)
mysql> insert into t1 values(200);
^CCtrl-C -- sending "KILL QUERY 13208" to server ...
Ctrl-C -- query aborted.
ERROR 1317 (70100): Query execution was interrupted
mysql> use DEVOPS;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> insert into t1 values(99999,'aaa');
FLUSH TABLES WITH READ LOCK 锁全局
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Flush tables with read lock (FTWRL)全局锁就是对整个数据库实例加锁
mysql
html 前端 MySQL SQL 读锁