mysql> lock tables test read;
Query OK, 0 rows affected (0.00 sec)mysql> select * from test;
+------+------+------+------+------+------+
| a | b | c | d | e | f |
+------+------+------+------+------+------+
| 1 | 1 | 1 | 1 | x | m |
| 2 | 2 | 2 | 2 | x | m |
| 4 | 4 | 4 | 4 | y | n |
| 5 | 5 | 5 | 5 | y | n |
| 3 | 3 | 3 | 3 | y | m |
+------+------+------+------+------+------+
5 rows in set (0.00 sec)mysql> select * from a;
ERROR 1100 (HY000): Table 'a' was not locked with LOCK TABLES
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)mysql> select * from a;
Empty set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)mysql> select * from test;
+------+------+------+------+------+------+
| a | b | c | d | e | f |
+------+------+------+------+------+------+
| 1 | 1 | 1 | 1 | x | m |
| 2 | 2 | 2 | 2 | x | m |
| 4 | 4 | 4 | 4 | y | n |
| 5 | 5 | 5 | 5 | y | n |
| 3 | 3 | 3 | 3 | y | m |
+------+------+------+------+------+------+
5 rows in set (0.00 sec)mysql> select * from a;
ERROR 1100 (HY000): Table 'a' was not locked with LOCK TABLES
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)mysql> select * from a;
Empty set (0.00 sec)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货