<pre name="code" class="sql"><pre name="code" class="sql">mysqldump备份myisam 默认不会锁表:
[mysql@master data]$ mysqldump test t4 >t4.sql
mysql> insert into t4 values(30006,'a','a','20100101');
Query OK, 1 row affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select max(student_id) from t4;
+-----------------+
| max(student_id) |
+-----------------+
| 30006 |
+-----------------+
1 row in set (0.00 sec)
为了保证数据的一致性:
mysqldump:
-l, --lock-tables Lock all tables for read.
(Defaults to on; use --skip-lock-tables to disable.)
只针对Innodb ,对myisam 不支持
mysqldump 备份myisam 时不锁表
[mysql@master ~]$ mysqldump test t4>t4.sql
要锁住的话 只能:
mysql> lock table t4 read;
Query OK, 0 rows affected (0.01 sec)
在进行备份