Command options for establishing a connection (refer to the MySQL official documentation)

Command options for establishing a connection (refer to the MySQL official documentation)

This article describes how to establish control client program option of connection to the server.
Connection setup options summary

Option Name Description
--default-auth authentication plug-in to use
--host host where the MySQL server
password to use when connecting to the server --password
the --pipe using named pipes to connect to the server (only Windows)
--plugin- plug-in installation directory dir
--port port
--protocol agreement
--secure-auth security authentication
--shared-memory-base-name-based shared memory name
--socket Unix socket file or Windows named pipe to use
- -user to use when connecting to the server, MySQL user name

• --host = host_name, -h host_name
host running MySQL server. This value can be a host name, IPv4 address or IPv6 address. The default value is localhost.
• --password [= pass_val], -p [pass_val]
for the password to connect to the MySQL server account. Password value is optional. If no, the program prompts for a.
Given, then no space between --password = or-p and the following code. If the password option is not specified, the default is to not send the password.
Specify a password on the command line should be considered insecure. To avoid entering a password on the command line, use the option file.
To explicitly specify no password, and the client program should not be prompted for a password, use --skip password option.

• --plugin-dir = dir_name
find the directory plug-ins. If --default auth option is used to specify the authentication plug-in, but the client can not find it, please specify this option.
• --port = port_num, -P port_num
for TCP / IP connections, the port number used. The default port number is 3306.

• --protocol = {TCP | SOCKET | PIPE | MEMORY}
option explicitly specify the protocol used to connect to the server. When other connection parameters normally lead to the use of protocols other than the desired protocol, this option is useful. For example, on Unix, default Unix socket file to establish a connection in the case where local host:
MySQL --host = localhost

To force the use of TCP / IP connection, specify --protocol options:
MySQL --host = localhost TCP --protocol =

The following table shows the allowable --protocol option values, and each value indicates the platform can be used. These values ​​are not case-sensitive.

--protocol
Value Permissible Operating Systems Connection Protocol
TCP and TCP local or remote server / IP connection All
SOCKET to the local server Unix socket file connection only Unix
PIPE to a local or remote server named pipe connections only Windows
the MEMORY local server shared memory connection Windows only

• --secure-auth
Do not send passwords to the server to format the old (pre-4.1). This will prevent the outside server connections using the new password format.
Starting from MySQL 5.7.5, this option has been deprecated and will be removed in future versions of MySQL. It is always enabled, and try to disable it (--skip secure auth, - secure auth = 0) produces an error.
Prior to MySQL 5.7.5, this option is enabled by default, but can be disabled.

Note
the use of pre-4.1 password hashing method is lower than that of password security using the native password hashing method, should be avoided. Not recommended before the 4.1 version of the password has been removed support for these passwords in MySQL 5.7.5 in.

• --socket = path, -S path
on Unix, using named pipes for local server Unix socket file name to establish the connection. The default Unix socket file name is /tmp/mysql.sock.
On Windows, the name of the named pipe used to connect to the local server. The default Windows pipe name is MySQL. Pipeline names are not case sensitive.
On Windows, enabled only when the server starts up support named pipe connections Named Pipes system variable, this option applies. In addition, users connect must be a member named "pipeline full access" by a set of system variables specified Windows group.
• --user = user_name, -u user_name
for the User name to connect to the MySQL server account. The default user name is the login name on Unix or Unix ODBC on Windows.

1, the command encrypted connection options
connection encryption option summary

Option Name Description
--get-server-public-key request from the server RSA public key
file --server-public-key-path contains the RSA public key pathname
--skip-ssl encrypted connection disabled
--ssl enable connection encryption
SSL certificate --ssl-ca containing the trusted authority list files
SSL certificate --ssl-capath containing the trusted authority certificate file directory
file --ssl-cert contains X.509 certificates
--ssl-cipher password encryption allows connection
--ssl-crl comprises certificate revocation list file
directory --ssl-crlpath certificate revocation list file comprising
file --ssl-key includes an X.509 key
--ssl-mode connection to the server required security state
--ssl-verify-server-cert identification verification in accordance with the host name of the server certificate common name
--tls-version encrypted connection allows TLS protocol

Guess you like

Origin www.cnblogs.com/sunkang-dba/p/12058299.html