Quantcast
Channel: MySQL 中文网 - MySQL基础知识
Viewing all articles
Browse latest Browse all 60

[MySQL FAQ]系列 -- mysqldump选项之skip-opt

0
0

最近在用mysqldump备份时,想要把数据表和数据分开备份,因此做了2次备份。
执行备份数据库表结构时,指定了 --skip-opt 选项,相当于禁用下面几个参数:

--add-drop-table, --add-locks,
--create-options, --quick, --extended-insert,
--lock-tables, --set-charset, and --disable-keys

选项 --create-option 看起来比较不起眼:

  -a, --create-options 
      Include all MySQL specific create options.

事实上,如果把它disable的话,备份出来的表结构,会少了:

AUTO_INCREMENT   --PK字段的AUTO_INCREMENT属性以及数据表的AUTO_INCREMENT属性都会丢掉
ENGINE=InnoDB DEFAULT CHARSET=utf8  --数据表的引擎、字符集属性

等MySQL特有的数据表属性,需要注意下,版本信息见下:

Server version:         5.5.19-55-log Percona Server (GPL), Release rel24.0, Revision 204

mysqldump --version
mysqldump  Ver 10.13 Distrib 5.5.19, for Linux (x86_64)

Viewing all articles
Browse latest Browse all 60

Latest Images

Trending Articles





Latest Images