In addition to specifying connection parameters using a URI, it is also possible to define the connection data using separate parameters for each value.
Use the following parameters:
--dbuser(-u)value--dbpasswordvalue--host(-h)value--port(-P)value--schema(-D)value--password(-p)--socket(-S)
The first 5 parameters match the tokens used in the URI format described at Section 18.2.2.1, “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:
--passwordis equivalent to--dbpassword--databaseis equivalent to--schema
When parameters are specified in multiple ways, the following rules apply:
Attempt to establish an XSession with a specified user at port 33065.
shell> mysqlsh -u user -h localhost -P 33065Attempt to establish a Classic Session with a specified user.
shell> mysqlsh -u user -h localhost --classicAttempt to establish a Node Session with a specified user.
shell> mysqlsh --node -u user -h localhost