Create session settings from a connection string.
Connection sting has the form
"user:pass@connection-data/db?option&option"
with optional mysqlx://
prefix.
The connetction-data
part is either a single host address or a coma separated list of hosts in square brackets: [host1, host2, ..., hostN]
. In the latter case the connection fail-over logic will be used when creating the session.
A single host address is either a DNS host name, an IPv4 address of the form nn.nn.nn.nn
or an IPv6 address of the form [nn:nn:nn:...]
. On Unix systems a host can be specified as a path to a Unix domain socket - this path must start with /
or .
.
Characters like /
in the connection data, which otherwise have a special meaning inside a connection string, must be represented using percent encoding (e.g., %2F
for /
). Another option is to enclose a host name or a socket path in round braces. For example, one can write
"mysqlx://(./path/to/socket)/db"
instead of
"mysqlx://.%2Fpath%2Fto%2Fsocket/db"
To specify priorities for hosts in a multi-host settings, use list of pairs of the form (address=host,priority=N)
. If priorities are specified, they must be given to all hosts in the list.
The optional db
part of the connection string defines the default schema of the session.
Possible connection options are: