The following commands are used to work with stored sessions within MySQL Shell.
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
namealready exists, an error occurs. Use this parameter to force storing the connection, which overrides what was previously stored under the given session name.
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.
To remove a connection use:
name: Mandatory parameter that indicates the connection data to be removed.
Stored connections can be used to create a global session by
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.