MySQL Shell 8.0

4.3.1 Connecting using Individual Parameters

In addition to specifying connection parameters using a connection string, it is also possible to define the connection data when starting MySQL Shell using separate command parameters for each value. For a full reference of MySQL Shell command options see Section A.1, “mysqlsh — The MySQL Shell”.

Use the following connection related parameters:

The command options behave similarly to the options used with the mysql client described at Connecting to the MySQL Server Using Command Options.

Use the following command options to control whether and how a password is provided for the connection:

When parameters are specified in multiple ways, for example using both the --uri option and specifying individual parameters such as --user, the following rules apply:

Connections from MySQL Shell to a server can be encrypted, and can be compressed, if you request these features and the server supports them. For instructions to establish an encrypted connection, see Section 4.3.4, “Using Encrypted Connections”. For instructions to establish a compressed connection, see Section 4.3.7, “Using Compressed Connections”.

The following examples show how to use command parameters to specify connections. Attempt to establish an X Protocol connection with a specified user at port 33065:

$> mysqlsh --mysqlx -u user -h localhost -P 33065

Attempt to establish a classic MySQL protocol connection with a specified user, requesting compression for the connection:

$> mysqlsh --mysql -u user -h localhost -C