Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.4Mb
PDF (A4) - 37.5Mb
PDF (RPM) - 33.2Mb
HTML Download (TGZ) - 8.3Mb
HTML Download (Zip) - 8.4Mb
HTML Download (RPM) - 7.3Mb
Man Pages (TGZ) - 130.1Kb
Man Pages (Zip) - 185.6Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb


Pre-General Availability Draft: 2018-02-24

19.2.1 MySQL Shell Connections

MySQL Shell can connect to MySQL Server using both the X Protocol and the classic MySQL protocol. The address of the MySQL Server which you want to connect to can be specified using individual parameters, such as user, hostname and port, or using a Uniform Resource Identifier (URI) type string. The following sections describe these connection methods. See Section 4.2.2, “Connecting to the MySQL Server” for more background information.

You can configure the MySQL server instance that MySQL Shell is connected to in the following ways:

These methods all support Section 19.2.1.1, “Connecting using a URI String”.

Important

Regardless of the method you choose to connect it is important to understand how passwords are handled by MySQL Shell. By default connections are assumed to require a password. The password is requested at the login prompt. To specify a password-less account use the --password option and do not specify a password, or use a : after the user in a URI type string and do not specify a password.

If you do not specify parameters for a connection the following defaults are used:

  • user defaults to the current system user name

  • host defaults to localhost

  • port defaults to the X Plugin port 33060 when using an X Protocol session, and port 3306 when using a Classic session

MySQL Shell connections using X Protocol can use either TCP or Unix sockets as of version 8.0.4. Previous versions use only TCP for X Protocol connections and using Unix sockets is not supported. MySQL Shell connections using MySQL Protocol default to using Unix sockets when the following conditions are met:

  • A TCP port is not specified

  • A host name is not specified or it is equal to localhost

  • A socket is provided with a path to a socket file

  • A classic session is specified

If a host name is specified but it is not localhost, a TCP connection is established. In this case, if a TCP port is not specified the default value of 3306 is used. If the conditions are met for a socket connection but a path to a socket file is not specified then the default socket is used. See Section 4.2.2, “Connecting to the MySQL Server”.


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