mysqldump语句参数详解

mysqldump语句参数详解

版本:mysqldump  Ver 10.13 Distrib 5.7.17, for Win64 (x86_64)

参数:

--print-defaults

打印程序参数列表并退出  Print the program argument list and exit.


--no-defaults

不从任何文件中读取默认选项,除非登录文件 Don't read default options from any option file,except for login file.


--defaults-file=#

只读取执行的文件 Only read default options from the given file #.


--defaults-extra-file=#

读取全局文件后读取#文件 Read this file after the global files are read.


--defaults-group-suffix=#

同时读取concat组  Also read groups with concat(group, suffix)


--login-path=#

从登录文件中读取路径 Read this path from the login file.
  -A, --all-databases

 转储所有数据库,等同于--databases命令 Dump all the databases. This will be same as --databases with all databases selected.


  -Y, --all-tablespaces

 转储所有表空间信息  Dump all the tablespaces.


  -y, --no-tablespaces

 不转储任何表空间信息  Do not dump any tablespace information.


  --add-drop-database

 在创建之前添加一个drop database命令  Add a DROP DATABASE before each create.


  --add-drop-table

 在创建之前添加一个drop table命令, 默认on,使用--skip-add-drop-table关闭 Add a DROP TABLE before each create. (Defaults to on; use --skip-add-drop-table to disable.)


  --add-drop-trigger

 在创建之前添加一个drop trigger命令  Add a DROP TRIGGER before each create.


  --add-locks

  在插入语句周围添加锁 默认on,使用--skip-add-locks关闭 Add locks around INSERT statements.(Defaults to on; use --skip-add-locks to disable.)


  --allow-keywords

 允许创建以关键字为名称的字段    Allow creation of column names that are keywords.


  --apply-slave-statements
 添加“停止从属”前改变主从关联  Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START  SLAVE' to bottom of dump.


  --bind-address=name

 绑定ip地址 IP address to bind to.


  --character-sets-dir=name

 设置默认字符集文件  Directory for character set files.


  -i, --comments

 显示用法信息,默认on,关闭使用:--skip-comments     Write additional information.(Defaults to on; use --skip-comments to disable.)


  --compatible=name

 将转储转换为给定的name方式,允许格式:ansi, mysql323, mysql40,postgresql, oracle, mssql, db2, maxdb, no_key_options,no_table_options, no_field_options

注:需要MySQL服务器或更高版本4.1.0。此选项被忽略早期服务器版本。   

Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40,            postgresql, oracle, mssql, db2, maxdb, no_key_options,no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.


  --compact

 用于输出的控制项,可用选项:--skip-add-drop-table/--skip-add-locks/--skip-comments/--skip-disable-keys/--skip-set-charset

  -c, --complete-insert

 使用完整插入语句  Use complete insert statements.


  -C, --compress

 在服务器或者客户端协议中使用压缩  Use compression in server/client protocol.


  -a, --create-options
 包括所有Mysql的创建选项,默认on,使用--skip-create-options关闭 Include all MySQL specific create options.(Defaults to on; use --skip-create-options to disable.)


  -B, --databases

 转储所有数据库     Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.


  --default-character-set=name
 设置默认字符集  Set the default character set.


  --delete-master-logs

 备份后删除主记录日志,同时将自动启用--master-data功能  Delete logs on master after backup. This automatically enables --master-data.


  -K, --disable-keys

 输出中修改表的主键显示方式,默认on,使用--skip-disable-keys关闭


  --dump-slave[=#]

 将导致主日志的二进制日志位置和文件名追加到转储输出中,等于1和等于2时有根本的差异

  -E, --events

 不是太明白  Dump events.


  -e, --extended-insert
  使用包含多个值列表的多行插入语法  Use multiple-row INSERT syntax that include several VALUES lists.(Defaults to on; use --skip-extended-insert to disable.)


  --fields-terminated-by=name

 输出文件中的字段由给定的字符串终止  Fields in the output file are terminated by the given string.


  --fields-enclosed-by=name

 输出文件中的字段由给定字符封闭 Fields in the output file are enclosed by the given character.


  --fields-optionally-enclosed-by=name

 输出文件中的字段可选地由给定字符封闭  Fields in the output file are optionally enclosed by the given character.


  --fields-escaped-by=name

 输出文件中的字段由给定字符转义  Fields in the output file are escaped by the given character.


  -F, --flush-logs

 服务器将在开始转储前刷新日志文件 


  --flush-privileges

 转储数据库后将刷新权限


  -f, --force 

 继续执行后续命令,即使报错 Continue even if we get an SQL error.


  -?, --help

 显示帮助信息


  --hex-blob

 十六进制信息将以二进制转储   Dump binary strings (BINARY, VARBINARY, BLOB) in  hexadecimal format.


  -h, --host=name

 连接的服务器 Connect to host.


  --ignore-error=name

  转储时,遇到以逗号分隔的错误列表将被忽略 A comma-separated list of error numbers to be ignored if  encountered during dump.


  --ignore-table=name

  转储时需要忽略的表 


  --include-master-host-port

 包含主机服务器地址


  --insert-ignore 

 插入带有忽略插入的行 Insert rows with INSERT IGNORE.


  --lines-terminated-by=name

 输出文件中的行由给定字符串终止   Lines in the output file are terminated by the given string.


  -x, --lock-all-tables
 锁定所有数据库的所有表


  -l, --lock-tables

 锁定所有表为读   Lock all tables for read. (Defaults to on; use --skip-lock-tables to disable.)


  --log-error=name

 附加错误和警告至给定文件 Append warnings and errors to given file.


  --master-data[=#] 

 将导致主日志的二进制日志位置和文件名追加到转储输出中,等于1和等于2时有根本的差异


  --max-allowed-packet=#

 服务器发送和接收的最大数据包长度  The maximum packet length to send to or receive from server.


  --net-buffer-length=#

 为TCP/IP或者Socket协议准备的缓冲区大小 The buffer size for TCP/IP and socket communication.


  --no-autocommit

 不自动提交声明 Wrap tables with autocommit/commit statements.


  -n, --no-create-db

 不建立数据库

  -t, --no-create-info

 不写入表创建信息   Don't write table creation info.


  -d, --no-data 

 不写入行信息 No row information.


  -N, --no-set-names

 不写入默认字符集 Same as --skip-set-charset.


  --opt 

 等同于--add-drop-table, --add-locks, --create-options,--quick, --extended-insert, --lock-tables, --set-charset,and --disable-keys. Enabled by default, disable with --skip-opt.


  --order-by-primary

   按照主键排序


  -p, --password[=name]

 连接服务器时使用的密码


  -W, --pipe

 使用命名管道连接至服务器 Use named pipes to connect to server.


  -P, --port=# 

 连接服务器时使用的端口号 Port number to use for connection.


  --protocol=name

 连接时使用的协议(TCP,SOCKET,PIPE,MEMORY)The protocol to use for connection (tcp, socket, pipe,memory).


  -q, --quick

 不缓存查询 默认on,使用--skip-quick关闭 Don't buffer query, dump directly to stdout.(Defaults to on; use --skip-quick to disable.)


  -Q, --quote-names

 用引号引用表名和字段名,默认on,使用--skip-quote-names关闭   Quote table and column names with backticks (`).(Defaults to on; use --skip-quote-names to disable.)


  --replace 

 用替代代替插入 Use REPLACE INTO instead of INSERT INTO.


  -r, --result-file=name

 输出到指定文件


  -R, --routines

 转储存储列程 Dump stored routines (functions and procedures).


  --set-charset 

 添加“默认字符集”至输出文件,默认on,使用--skip-set-charset关闭   Add 'SET NAMES default_character_set' to the output.(Defaults to on; use --skip-set-charset to disable.)


  --set-gtid-purged[=name]

 添加“SET @@GLOBAL.GTID_PURGED”至输出文件


  --shared-memory-base-name=name

 设置共享内存的基础名称  Base name of shared memory.


  --single-transaction

 创建快照


  --dump-date

 将转储日期放在输出端 Put a dump date to the end of the output. (Defaults to on; use --skip-dump-date to disable.)


  --skip-opt

 关闭--opt相应功能


  -S, --socket=name

 连接使用的Socket文件   The socket file to use for connection.


  --secure-auth 

 已过时


  --ssl-mode=name 

 SSL连接模式 SSL connection mode.


  --ssl  

 已过时


  --ssl-verify-server-cert

 已过时


  --ssl-ca=name

 PEM格式的CA文件


  --ssl-capath=name

 CA路径 CA directory.


  --ssl-cert=name

 PEM格式的X509 cert


  --ssl-cipher=name

 SSL使用的密码 SSL cipher to use.


  --ssl-key=name

 PEM格式的X509 key


  --ssl-crl=name

 撤销的证书列表 Certificate revocation list.


  --ssl-crlpath=name  Certificate revocation list path.

 撤销的证书列表路径


  --tls-version=name

 使用的TLS版本号, 只允许: TLSv1, TLSv1.1


  -T, --tab=name 

 制表符分隔的文本文件创建为每个表指定的路径


  --tables

 覆盖选项 Overrides option --databases (-B).


  --triggers

 为每个表转储触发器,默认on,使用--skip-triggers关闭          Dump triggers for each dumped table. (Defaults to on; use --skip-triggers to disable.)


  --tz-utc

 设定时区


  -u, --user=name

 连接时使用的用户名 User for login if not current user.


  -v, --verbose

 打印各个阶段的信息 Print info about the various stages.


  -V, --version

 输出版本信息 Output version information and exit.


  -w, --where=name

 仅转储指定的记录 引号是必须的 Dump only selected records. Quotes are mandatory.


  -X, --xml

 转储为XML格式的文件 Dump a database as well formed XML.


  --plugin-dir=name

 客户端插件目录 Directory for client-side plugins.


  --default-auth=name

 使用默认身份验证客户端插件  Default authentication client-side plugin to use.


  --enable-cleartext-plugin

 启用或者禁用明文验证插件   Enable/disable the clear text authentication plugin.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值