MySQL Router 8.0

4.3.3 Configuration File Options

When started, MySQL Router reads a list of configuration files that together make up the configuration of the router. At least one configuration file is required.

MySQL Router reads options from configuration files that closely resemble the traditional INI file format, with sections and options. These specify the options set when MySQL Router starts. For file syntax information, see Section 4.1, “Configuration File Syntax”.

Options are defined under sections, that dictate the option's meaning. For example, user under the [DEFAULT] section refers to the system user running router, while user under the [metadata_cache] section refers to the MySQL user that accesses metadata.

The following tables are separated by section, and summarize the MySQL Router options defined in a MySQL Router configuration file. Detailed information about each of these options, such as descriptions and allowed values, is documented below these tables.

General Options

Table 4.7 [DEFAULT]

Option Name Description Type
config_folder Path to configuration files String
connect_timeout Number of seconds before connection attempts to a metadata server are considered timed out Integer
core-file Write core file on Router crashes Boolean
event_source_name Microsoft Windows platforms only. Defines the service name used by MySQL Router when it is run as a service on Microsoft Windows. String
keyring_path Path to keyring file String
logging_folder Path to router logs String
master_key_path Path to master keyring file String
master-key-reader Script that returns the master key to STDOUT String
master-key-writer Script that reads the master key from STDIN String
max_total_connections Total maximum number of allowed client connections from the router Integer
pid_file Location to store the PID file String
plugin_folder Path to router plugins String
runtime_folder Path to runtime files String
sinks Logging method(s) to receive configured log data String
thread_stack_size Size in KB of memory allocated to each thread stack Integer
unknown_config_option Error type sent if an unknown configuration option is encountered String
user System user MySQL Router is run as String

Routing Options

Table 4.8 [routing]

Option Name Description Type
bind_address Address router is bound to, also uses bind_port if a port is not defined String
bind_port Default port used by bind_address Integer
client_connect_timeout Maximum number of seconds to receive packets from MySQL server Integer
client_ssl_cert The path to the SSL certificate (PEM) used to encrypt client-to-router communications String
client_ssl_cipher Which ciphers are allowed between client and MySQL Router, defaults to a secure list of SSL ciphers String
client_ssl_curves Which curves are allowed between the client and MySQL Router, defaults to a secure list of SSL curves String
client_ssl_dh_params Filename of the DH parameter file. Not set by default String
client_ssl_key The path to the SSL private key certificate file (PEM) used to encrypt client-to-router communications String
client_ssl_mode Controls if connections from the client to MySQL Router must be encrypted, defaults to PREFERRED if not set String
connect_timeout Number of seconds before connection attempts to a MySQL server are considered timed out Integer
connection_sharing Whether to enable connection sharing. Integer
connection_sharing_delay Seconds to wait before moving an idle connection to the connection pool. Numeric
destinations Routing destinations as either a comma-separated list of MySQL servers, or a metadata-cache definition String
dynamic_state Path to generated JSON file used to track and store active MySQL InnoDB Cluster Metadata server addresses String
max_connect_errors Maximum number of failed MySQL server connections before giving up Integer
max_connections Maximum number of connections assigned to a routed destination MySQL server Integer
mode Routing mode, how router chooses destination MySQL servers String
net_buffer_length Set net_buffer_length Integer
protocol Protocol for connecting to MySQL Server String
read_timeout Number of seconds before read operations to a metadata server are considered timed out Integer
routing_strategy Routing strategy (optional), how router chooses destination MySQL servers String
server_ssl_ca The path to the Certificate Authority (CA) certificate file in PEM format String
server_ssl_capath The path to the directory that contains the trusted SSL Certificate Authority (CA) certificate files in PEM format. String
server_ssl_cipher SSL Cipher for Server String
server_ssl_crl The path to the file containing the certificate revocation lists in PEM format String
server_ssl_crlpath The path to the directory that contains the certificate revocation list files in PEM format String
server_ssl_curves SSL Curves for Server String
server_ssl_mode Controls if connections from router to server must be encrypted String
server_ssl_verify Verification of the SSL certificates presented to the router by the server String
socket Path to Unix domain socket file String
unreachable_destination_refresh_interval How often, in seconds, unreachable destination candidates are probed for availability. Integer

Destination Status Options

Table 4.9 [destination_status]

Option Name Description Type
error_quarantine_interval Defines the interval, in seconds, between checks on quarantined destination connectivity. If a connection is possible, the destination is moved out of quarantine and made available for connections. Integer
error_quarantine_threshold Defines the threshold of consecutive, failed attempts to connect to a routing destination before MySQL Router adds the destination to quarantine and stops using it as a destination until it is cleared by the quarantine mechanism. For example, if set to 5, the destination is quarantined after 5 consecutive, failed attempts to connect to it. Integer

Table 4.10 [connection_pool]

Option Name Description Type
idle_timeout Seconds to keep the idling connection in the collection pool before closing it Numeric
max_idle_server_connections Connections to keep open after the client disconnects Numeric

Metadata Cache Options

Table 4.11 [metadata_cache]

Option Name Description Type
auth_cache_refresh_interval Time between auth-cache refresh attempts Numeric
auth_cache_ttl Time until the cache becomes invalid if not refreshed Numeric
bootstrap_server_addresses MySQL servers with metadata, as a comma-separated list String
cluster_type Object Router was bootstrapped against String
metadata_cluster InnoDB Cluster name String
router_id Router ID Integer
ssl_ca SSL CA file to verify server's certificate against String
ssl_capath Directory containing SSL CA files to verify server's certificate against String
ssl_crl SSL CRL file to verify server's certificate against String
ssl_crlpath Directory containing SSL CRL files to verify server's certificate against String
ssl_mode SSL connection mode for connecting to the metadata server, defaults to PREFERRED if not set String
tls_version Comma-separated list of TLS versions to request, if SSL is enabled String
ttl Time To Live, in seconds Integer
use_gr_notifications Group Replication notifications behavior Integer
user MySQL user that accesses the MySQL Server's metadata schema String

Logging Options

Table 4.12 [logger]

Option Name Description Type
destination Name of device to log to; optionally used with [consolelog] String
filename Log file name; optionally used with [logger] and [filelog] String
level Logging level String
timestamp_precision Logger timestamp precision String

HTTP Server Options

Table 4.13 [http_server]

Option Name Description Type
bind_address IP address bound to the HTTP port String
port HTTP server TCP port Integer
require_realm [http_auth_realm] name String
ssl_cert SSL certification file name String
ssl_cipher Approved SSL ciphers String
ssl_dh_param DH parameter file name String
ssl Enables TLSv1.2 or later support Integer
ssl_key SSL key filename String
static_folder Directory for HTTP server static file requests String

Table 4.14 [http_auth_realm]

Option Name Description Type
backend Name of the [http_auth_backend] section String
method The HTTP authentication method String
name Realm name for authenticated user String
require Require authentication validation String

Table 4.15 [http_auth_backend]

Option Name Description Type
backend Backend type String
filename Backend storage file name String

Table 4.16 [io]

Option Name Description Type
backend The IO backend String
threads The IO thread count Numeric

MySQL Router Configuration File Option Descriptions