MySQL Connector/C++
MySQL connector library for C and C++ applications
Public Types | List of all members
SessionOption Class Reference

Session creation options. More...

Public Types

enum  Enum {
  URI = 1 , HOST = 2 , PORT = 3 , PRIORITY = 4 ,
  USER = 5 , PWD = 6 , DB = 7 , SSL_MODE = 8 ,
  SSL_CA = 9 , AUTH = 10 , SOCKET = 11 , CONNECT_TIMEOUT = 12 ,
  CONNECTION_ATTRIBUTES = 13 , TLS_VERSIONS = 14 , TLS_CIPHERSUITES = 15 , DNS_SRV = 16 ,
  COMPRESSION = 17 , COMPRESSION_ALGORITHMS = 18 , SSL_CAPATH = 19 , SSL_CRL = 20 ,
  SSL_CRLPATH = 21 , LAST
}
 Possible session creation options. More...
 

Detailed Description

Session creation options.

Note
PRIORITY should be defined after a HOST (PORT) to which it applies.
Specifying SSL_CA option requires SSL_MODE value of VERIFY_CA or VERIFY_IDENTITY. If SSL_MODE is not explicitly given then setting SSL_CA implies VERIFY_CA.

Member Enumeration Documentation

◆ Enum

enum Enum

Possible session creation options.

Enumerator
URI 

connection URI or string

HOST 

DNS name of the host, IPv4 address or IPv6 address

PORT 

X Plugin port to connect to

PRIORITY 

Assign a priority (a number in range 1 to 100) to the last specified host; these priorities are used to determine the order in which multiple hosts are tried by the connection fail-over logic (see description of Session class)

USER 

user name

PWD 

password

DB 

default database

SSL_MODE 

Specify SSLMode option to be used. In plain C code the value should be a #mysqlx_ssl_mode_t enum constant.

SSL_CA 

path to a PEM file specifying trusted root certificates

AUTH 

Authentication method to use, see AuthMethod. In plain C code the value should be a #mysqlx_auth_method_t enum constant.

SOCKET 

unix socket path

CONNECT_TIMEOUT 

Sets connection timeout in milliseconds. In C++ code can be also set to a std::chrono::duration value.

CONNECTION_ATTRIBUTES 

Specifies connection attributes (key-value pairs) to be sent when a session is created. The value is a JSON string (in C++ code can be also a DbDoc object) defining additional attributes to be sent on top of the default ones. Setting this option to false (in C++ code) or NULL (in plain C code) disables sending any connection attributes (including the default ones). Setting it to true (in C++ code) or empty string (in plain C code) requests sending only the default attributes which is also the default behavior when this option is not set.

TLS_VERSIONS 

List of allowed TLS protocol versions, such as "TLSv1.2". The value is a string with comma separated versions. In C++ code it can also be an iterable container with versions.

TLS_CIPHERSUITES 

List of allowed TLS cipher suites. The value is a string with comma separated IANA cipher suitenames (such as "TLS_RSA_WITH_3DES_EDE_CBC_SHA"). In C++ code it can also be an iterable container with names. Unknown cipher suites are silently ignored.

DNS_SRV 

If enabled (true) will check hostname for DNS SRV record and use its configuration (hostname, port, priority and weight) to connect.

COMPRESSION 

enable or disable compression

COMPRESSION_ALGORITHMS 

Specify compression algorithms in order of preference

SSL_CAPATH 

Path to a directory containing PEM files specifying trusted root certificates.

SSL_CRL 

Path to a PEM file containing certificate revocation lists

SSL_CRLPATH 

Path to a directory containing PEM files with certificate revocation lists


The documentation for this class was generated from the following file: