| –add-drop-database |
在建立库之前先执行删库操作 |
|
| –add-drop-table |
在建表之前先执行删表操作 |
|
| –add-drop-trigger |
在建触发器之前先执行删触发器操作 |
|
| –add-locks |
备份表时,使用LOCK TABLES和UNLOCK TABLES。注意:这个参数不支持并行备份,需要关闭并行备份功能:–default-parallelism=0 |
|
| –all-databases |
备份所有库 |
-A |
| –allow-keywords |
Allow creation of column names that are keywords |
|
| –apply-slave-statements |
Include STOP SLAVE prior to CHANGE MASTER statement and START SLAVE at end of output |
|
| –bind-address |
指定通过哪个网络接口来连接Mysql服务器(一台服务器可能有多个IP),防止同一个网卡出去影响业务。 |
|
| –character-sets-dir |
Directory where character sets are installed |
|
| –comments |
Add comments to dump file |
|
| –compact |
Produce more compact output |
|
| –compatible |
它告诉 mysqldump,导出的数据将和哪种数据库或哪个旧版本的 MySQL 服务器相兼容。值可以为 ansi、mysql323、mysql40、postgresql、oracle、mssql、db2、maxdb、no_key_options、no_tables_options、no_field_options 等,要使用几个值,用逗号将它们隔开。当然了,它并不保证能完全兼容,而是尽量兼容。 |
|
| –complete-insert |
导出的数据采用包含字段名的完整 INSERT 方式,也就是把所有的值都写在一行。这么做能提高插入效率,但是可能会受到 max_allowed_packet 参数的影响而导致插入失败。因此,需要谨慎使用该参数,至少我不推荐。 |
|
| –compress |
压缩客户端和服务器传输的所有的数据 |
-C |
| –create-options |
Include all MySQL-specific table options in CREATE TABLE statements |
|
| –databases |
手动指定要备份的库,支持多个数据库,用空格分隔 |
-B |
| –debug |
Write debugging log |
|
| –debug-check |
Print debugging information when program exits |
|
| –debug-info |
Print debugging information, memory, and CPU statistics when program exits |
|
| –default-auth |
Authentication plugin to use |
|
| –default-character-set |
指定备份的字符集。 |
|
| –defaults-extra-file |
Read named option file in addition to usual option files |
|
| –defaults-file |
Read only named option file |
|
| –defaults-group-suffix |
Option group suffix value |
|
| –delete-master-logs |
On a master replication server, delete the binary logs after performing the dump operation |
|
| –disable-keys |
告诉 mysqldump 在 INSERT 语句的开头和结尾增加 /*!40000 ALTER TABLE table DISABLE KEYS /; 和 /!40000 ALTER TABLE table ENABLE KEYS */; 语句,这能大大提高插入语句的速度,因为它是在插入完所有数据后才重建索引的。该选项只适合 MyISAM 表。 |
|
| –dump-date |
Include dump date as “Dump completed on” comment if --comments is given |
|
| –dump-slave |
Include CHANGE MASTER statement that lists binary log coordinates of slave’s master |
|
| –enable-cleartext-plugin |
Enable cleartext authentication plugin 5.7.10 |
|
| –events |
Dump events from dumped databases |
|
| –extended-insert |
默认情况下,mysqldump 开启 --complete-insert 模式,因此不想用它的的话,就使用本选项,设定它的值为 false 即可。 |
|
| –fields-enclosed-by |
This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE |
|
| –fields-escaped-by |
This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE |
|
| –fields-optionally-enclosed-by |
This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE |
|
| –fields-terminated-by |
This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE |
|
| –flush-logs |
Flush MySQL server log files before starting dump |
|
| –flush-privileges |
Emit a FLUSH PRIVILEGES statement after dumping mysql database |
|
| –force |
Continue even if an SQL error occurs during a table dump |
|
| –help |
Display help message and exit |
|
| –hex-blob |
使用十六进制格式导出二进制字符串字段。如果有二进制数据就必须使用本选项。影响到的字段类型有 BINARY、VARBINARY、BLOB。 |
|
| –host |
Host to connect to (IP address or hostname) |
|
| –ignore-error |
Ignore specified errors 5.7.1 |
|
| –ignore-table |
Do not dump given table |
|
| –include-master-host-port |
Include MASTER_HOST/MASTER_PORT options in CHANGE MASTER statement produced with --dump-slave |
|
| –insert-ignore |
Write INSERT IGNORE rather than INSERT statements |
|
| –lines-terminated-by |
This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE |
|
| –lock-all-tables |
在开始导出之前,提交请求锁定所有数据库中的所有表,以保证数据的一致性。这是一个全局读锁,并且自动关闭 --single-transaction 和 --lock-tables 选项。 |
-x |
| –lock-tables |
它和 --lock-all-tables 类似,不过是锁定当前导出的数据表,而不是一下子锁定全部库下的表。本选项只适用于 MyISAM 表,如果是 Innodb 表可以用 --single-transaction 选项。 |
|
| –log-error |
Append warnings and errors to named file |
|
| –login-path |
Read login path options from .mylogin.cnf |
|
| –master-data |
Write the binary log file name and position to the output |
|
| –max_allowed_packet |
Maximum packet length to send to or receive from server |
|
| –net_buffer_length |
Buffer size for TCP/IP and socket communication |
|
| –no-autocommit |
Enclose the INSERT statements for each dumped table within SET autocommit = 0 and COMMIT statements |
|
| –no-create-db |
Do not write CREATE DATABASE statements |
|
| –no-create-info |
只导出数据,而不添加 CREATE TABLE 语句。 |
-t |
| –no-data |
不导出任何数据,只导出数据库表结构。 |
-d |
| –no-defaults |
Read no option files |
|
| –no-set-names |
Same as --skip-set-charset |
|
| –no-tablespaces |
Do not write any CREATE LOGFILE GROUP or CREATE TABLESPACE statements in output |
|
| –opt |
这只是一个快捷选项,等同于同时添加 --add-drop-tables --add-locking --create-option --disable-keys --extended-insert --lock-tables --quick --set-charset 选项。本选项能让 mysqldump 很快的导出数据,并且导出的数据能很快导回。该选项默认开启,但可以用 --skip-opt 禁用。注意,如果运行 mysqldump 没有指定 --quick 或 --opt 选项,则会将整个结果集放在内存中。如果导出大数据库的话可能会出现问题。 |
|
| –order-by-primary |
Dump each table’s rows sorted by its primary key, or by its first unique index |
|
| –password |
备份需要的密码 |
-p |
| –pipe |
On Windows, connect to server using named pipe |
|
| –plugin-dir |
Directory where plugins are installed |
|
| –port |
备份数据库的TCP/IP端口 |
|
| –print-defaults |
Print default options |
|
| –protocol |
指定连接服务器的协议 {TCP/SOCKET/PIPE/MEMORY} |
|
| –quick |
该选项在导出大表时很有用,它强制 mysqldump 从服务器查询取得记录直接输出而不是取得所有记录后将它们缓存到内存中。 |
-q |
| –quote-names |
Quote identifiers within backtick characters |
|
| –replace |
Write REPLACE statements rather than INSERT statements |
|
| –result-file |
Direct output to a given file |
|
| –routines |
导出存储过程以及自定义函数。 |
-R |
| –secure-auth |
Do not send passwords to server in old (pre-4.1) format 5.7.4 5.7.5 |
|
| –set-charset |
Add SET NAMES default_character_set to output |
|
| –set-gtid-purged |
Whether to add SET @@GLOBAL.GTID_PURGED to output |
|
| –shared-memory-base-name |
The name of shared memory to use for shared-memory connections |
|
| –single-transaction |
该选项在导出数据之前提交一个 BEGIN SQL语句,BEGIN 不会阻塞任何应用程序且能保证导出时数据库的一致性状态。它只适用于事务表,例如 InnoDB 和 BDB。本选项和 --lock-tables 选项是互斥的,因为 LOCK TABLES 会使任何挂起的事务隐含提交。要想导出大表的话,应结合使用 --quick 选项。 |
|
| –skip-add-drop-table |
Do not add a DROP TABLE statement before each CREATE TABLE statement |
|
| –skip-add-locks |
Do not add locks |
|
| –skip-comments |
Do not add comments to dump file |
|
| –skip-compact |
Do not produce more compact output |
|
| –skip-disable-keys |
Do not disable keys |
|
| –skip-extended-insert |
Turn off extended-insert |
|
| –skip-opt |
Turn off options set by --opt |
|
| –skip-quick |
Do not retrieve rows for a table from the server a row at a time |
|
| –skip-quote-names |
Do not quote identifiers |
|
| –skip-set-charset |
Do not write SET NAMES statement |
|
| –skip-triggers |
Do not dump triggers |
|
| –skip-tz-utc |
Turn off tz-utc |
|
| –socket |
For connections to localhost, the Unix socket file to use |
|
| –ssl |
Enable encrypted connection |
|
| –ssl-ca |
File that contains list of trusted SSL Certificate Authorities |
|
| –ssl-capath |
Directory that contains trusted SSL Certificate Authority certificate files |
|
| –ssl-cert |
File that contains X509 certificate |
|
| –ssl-cipher |
List of permitted ciphers for connection encryption |
|
| –ssl-crl |
File that contains certificate revocation lists |
|
| –ssl-crlpath |
Directory that contains certificate revocation list files |
|
| –ssl-key |
File that contains X509 key |
|
| –ssl-mode |
Security state of connection to server 5.7.11 |
|
| –ssl-verify-server-cert |
Verify host name against server certificate Common Name identity |
|
| –tab |
Produce tab-separated data files |
|
| –tables |
指定备份的表,多个用逗号分隔 |
|
| –tls-version |
Protocols permitted for encrypted connections 5.7.10 |
|
| –triggers |
同时导出触发器。该选项默认启用,用 --skip-triggers 禁用它。 |
|
| –tz-utc |
Add SET TIME_ZONE=’+00:00’ to dump file |
|
| –user |
MySQL user name to use when connecting to server |
|
| –verbose |
Verbose mode |
|
| –version |
Display version information and exit |
|
| –where |
Dump only rows selected by given WHERE condition |
|
| –xml |
Produce XML output |
|