mysqldump命令中,与「连接」有关选项

  LINUX MANUAL PAGES

mysqldump命令登录服务器后来获取相关的信息。以下选项指定了如何连接MySQL服务器(远程和本地主机)

–bind-address=ip_address
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server.

–compress, -C

Compress all information sent between the client and the server if both support compression.

–default-auth=plugin

A hint about the client-side authentication plugin to use. See Section 6.3.9, “Pluggable Authentication”.

–enable-cleartext-plugin

Enable the mysql_clear_password cleartext authentication plugin. (See Section 6.5.1.5, “Client-Side Cleartext Pluggable Authentication”.)

This option was added in MySQL 5.7.10.

–host=host_name, -h host_name

Dump data from the MySQL server on the given host. The default host is localhost.

–login-path=name
指定要使用的已命名的.mylogin.cnf文件中的「登录路径(login path)」

「登录路径(login path)」,是一个选项组,该选项组中保存了连接到MySQL服务器的登录认证信息。
有关登录路径的内容,参考官方文档:https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysql-utils-intro-connspec-mylogin.cnf.html

如果要创建或者修改「登录路径(login path)」文件,使用mysql_config_editor命令。
有关mysql_config_editor命令的使用方法可参考文档:https://dev.mysql.com/doc/refman/5.7/en/mysql-config-editor.html

–password[=password], -p[password]

The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the –password or -p option on the command line, mysqldump prompts for one.

Specifying a password on the command line should be considered insecure. See Section 6.1.2.1, “End-User Guidelines for Password Security”. You can use an option file to avoid giving the password on the command line.

–pipe, -W

On Windows, connect to the server using a named pipe. This option applies only if the server supports named-pipe connections.

–plugin-dir=dir_name

The directory in which to look for plugins. Specify this option if the –default-auth option is used to specify an authentication plugin but mysqldump does not find it. See Section 6.3.9, “Pluggable Authentication”.

–port=port_num, -P port_num

The TCP/IP port number to use for the connection.

–protocol={TCP|SOCKET|PIPE|MEMORY}

The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. For details on the permissible values, see Section 4.2.2, “Connecting to the MySQL Server”.

–secure-auth

Do not send passwords to the server in old (pre-4.1) format. This prevents connections except for servers that use the newer password format. This option was added in MySQL 5.7.4.

As of MySQL 5.7.5, this option is deprecated and will be removed in a future MySQL release. It is always enabled and attempting to disable it (–skip-secure-auth, –secure-auth=0) produces an error. Before MySQL 5.7.5, this option is enabled by default but can be disabled.

Note

Passwords that use the pre-4.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided. Pre-4.1 passwords are deprecated and support for them was removed in MySQL 5.7.5. For account upgrade instructions, see Section 6.5.1.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.

–socket=path, -S path

For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.

–ssl*

Options that begin with –ssl specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates. See Section 6.4.2, “Command Options for Encrypted Connections”.

–tls-version=protocol_list

The protocols permitted by the client for encrypted connections. The value is a comma-separated list containing one or more protocol names. The protocols that can be named for this option depend on the SSL library used to compile MySQL. For details, see Section 6.4.6, “Encrypted Connection Protocols and Ciphers”.

This option was added in MySQL 5.7.10.

–user=user_name, -u user_name

The MySQL user name to use when connecting to the server.

You can also set the following variables by using –var_name=value syntax:

max_allowed_packet

The maximum size of the buffer for client/server communication. The default is 24MB, the maximum is 1GB.

net_buffer_length

The initial size of the buffer for client/server communication. When creating multiple-row INSERT statements (as with the –extended-insert or –opt option), mysqldump creates rows up to net_buffer_length bytes long. If you increase this variable, ensure that the MySQL server net_buffer_length system variable has a value at least this large.

参考文献