Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.2Mb
PDF (A4) - 37.2Mb
PDF (RPM) - 36.6Mb
HTML Download (TGZ) - 10.1Mb
HTML Download (Zip) - 10.2Mb
HTML Download (RPM) - 8.8Mb
Man Pages (TGZ) - 206.0Kb
Man Pages (Zip) - 313.0Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  MySQL Shell Stored Session Commands

3.8.5.1 MySQL Shell Stored Session Commands

The following commands are used to work with stored sessions within MySQL Shell.

Adding a Connection

To add connection data for a session use:

\saveconn name [URI]
  • name : Mandatory parameter, the name that is assigned to the stored connection data. Note that this must be a valid identifier:

    • Starts with an alphabetic character.

    • Only contains alphanumeric characters and underscore.

  • URI : Optional parameter containing connection data in URI format. If not specified and a global session is active, the URI for the global session is used instead.

  • -f : Optional parameter to force overwriting an existing connection. If an attempt is made to store a connection, but the provided name already exists, an error occurs. Use this parameter to force storing the connection, which overrides what was previously stored under the given session name.

Updating a Stored Connection

To update the connection data for a specific session name use:

\saveconn -f name URI
  • name : Mandatory parameter, indicates the connection to be updated.

  • URI : Mandatory parameter, contains the connection data that replaces the connection for the indicated session name.

Removing a Stored Connection

To remove a connection use:

\rmconn name
  • name : Mandatory parameter that indicates the connection data to be removed.

Listing the Stored Connections

To list the stored connections use:

\lsconn
Using a Stored Connection

Stored connections can be used to create a global session by issuing a \connect name command. The stored session is loaded and used to create the global session.

When using a stored connection through the connect shell commands, you are prompted for the password if it is missing from the stored connection data.


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