You configure the MySQL Server which MySQL Shell connects to
by passing the connection data in string format using the
--uri command 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: specifies 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 options:
Connect with a Node Session at port 33065.
shell> mysqlsh --uri user@localhost:33065 --node
Connect with a Classic Session.
shell> mysqlsh --uri user@localhost --classic
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:
shell> mysqlsh --uri user:@localhost