You configure the MySQL Server which MySQL Shell connects to
by passing the connection data in string format using the
--uri command-line option.
Use the following format:
Descriptions of these options:
dbuser: specifies the MySQL user account to be used for the authentication process.
dbpassword: specifies the dbuser password to be used for the authentication process.Warning
Storing the password in the URI is not recommended.
host: specifies the host to which the session object connects. If not specified, localhost is used by default.
port: specifies which port the target MySQL server is listening on for the connection. If not specified, 33060 is used by default for the X Protocol enabled sessions, and 3306 is the default for traditional MySQL protocol sessions.
schema: Indicates the database to be set as default when the session is established.
If no password is specified using the URI, which is recommended, then the password is prompted for. The following examples show how to use these command-line options:
Connect with a Node Session at port 33065.
Connect with a Classic Session.
Although using a password-less account is not recommended, you
can specify a user without a password using a
: after the user name, for example:
In addition to specifying a URI manually, you can use a stored session. See Section 18.5, “Stored Sessions” for more information.