Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.7Mb
PDF (A4) - 37.7Mb
PDF (RPM) - 33.8Mb
HTML Download (TGZ) - 8.4Mb
HTML Download (Zip) - 8.4Mb
HTML Download (RPM) - 7.3Mb
Man Pages (TGZ) - 130.0Kb
Man Pages (Zip) - 185.6Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb

MySQL 8.0 Reference Manual  /  ...  /  Connecting using Individual Parameters

Pre-General Availability Draft: 2018-02-16 Connecting using Individual Parameters

In addition to specifying connection parameters using a URI type 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 4.5.7, “mysqlsh — The MySQL Shell”.

Use the following connection related parameters:

The first 5 parameters match the elements used in the URI type string format described at Section, “Connecting using a URI String”.

The --password parameter indicates the user should connect without a password.

For consistency, the following aliases are supported for some parameters:

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:

  • If an argument is specified more than once the value of the last appearance is used.

  • If both individual connection arguments and --uri are specified, the value of --uri is taken as the base and the values of the individual arguments override the specific component from the base URI.

    For example to override user from the URI:

    shell> mysqlsh --uri user@localhost:33065 --user otheruser

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.

shell> mysqlsh --mysqxl -u user -h localhost -P 33065

Attempt to establish a classic MySQL protocol connection with a specified user.

shell> mysqlsh --mysql -u user -h localhost

User Comments
Sign Up Login You must be logged in to post a comment.