MySQL Router 8.0

4.3.2.1 mysqlrouter — Command Line Options

MySQL Router accepts command line options that are passed into mysqlrouter to affect its behavior, or to bootstrap router based on an InnoDB Cluster.

When starting Router, you can optionally use --config to pass in the main configuration file's location (otherwise the default location is used) and --extra-config for an additional configuration file.

Bootstrapping command line options affect the generated files and directories that are used when starting MySQL Router.

mysqlrouter Option Summaries

Table 4.2 General Options

Option Name Description Introduced
--conf-set-option Sets a value for a generated configuration option during bootstrap 8.0.28
--config Read configuration options from the provided file
--extra-config Read this file after configuration files are read from either default locations or from files specified by the --config option
--help Display help text and exit
--pid-file Location to store the PID file 8.0.20
--user Run mysqlrouter as the user having the defined user name or numeric user id
--version Display version information and exit

Table 4.3 Bootstrapping Options

Option Name Description Introduced
--account The MySQL user account used by Router after bootstrapping 8.0.19
--account-create Bootstrapped account creation behavior 8.0.19
--account-host The host pattern used for bootstrapped accounts 8.0.12
--bootstrap Bootstrap and configure Router for operation with a MySQL InnoDB cluster
--bootstrap-socket Connect to the MySQL metadata server through a Unix domain socket, used in conjunction with --bootstrap
--conf-base-port Base port to use for listening Router ports
--conf-bind-address IP address of the interface to which router's listening sockets should bind
--conf-skip-tcp Whether to disable binding of a TCP port for incoming connections
--conf-target-cluster Sets the target_cluster metadata option to a cluster type 8.0.27
--conf-target-cluster-by-name Sets the target_cluster metadata option to a specific cluster name 8.0.27
--conf-use-gr-notifications Enables Group Replication notifications 8.0.17
--conf-use-sockets Whether to use Unix domain sockets
--connect-timeout Number of seconds before connection attempts to a metadata server are considered timed out
--directory Creates a self-contained directory for a new instance of the Router
--disable-rest Disables generation of REST API configuration details into the generated mysqlrouter.conf file 8.0.22
--force Force reconfiguration of a possibly existing instance of the router
--force-password-validation When creating a user account automatically, do not skip the validate_password mechanism
--https-port MySQL Router REST API HTTP server port 8.0.22
--master-key-reader Script that returns the master key to STDOUT 8.0.12
--master-key-writer Script that reads the master key from STDIN 8.0.12
--name Gives a symbolic name for the router instance
--password-retries The number of retries to use for generating the Router's user password
--read-timeout Number of seconds before read operations to a metadata server are considered timed out
--report-host Router's hostname; overrides auto-detection 8.0.12
--strict Enables bootstrap strict mode 8.0.19

Table 4.4 SSL Options

Option Name Description Introduced
--client-ssl-cert The path to the SSL public key certificate file, in PEM format, used to encrypt client-to-router connections 8.0.23
--client-ssl-cipher Which ciphers are allowed between client and MySQL Router, defaults to a secure list of SSL ciphers 8.0.23
--client-ssl-curves Which curves are allowed between the client and MySQL Router, defaults to a secure list of SSL curves 8.0.23
--client-ssl-dh-params Filename of the DH parameter file. Not set by default 8.0.23
--client-ssl-key The path name of the SSL private key file, in PEM format, used to encrypt client-to-router connections 8.0.23
--client-ssl-mode Controls if connections from the client to MySQL Router must be encrypted, defaults to PREFERRED if not set 8.0.23
--server-ssl-ca The path to the Certificate Authority (CA) certificate file in PEM format 8.0.23
--server-ssl-capath The path to the directory that contains the trusted SSL Certificate Authority (CA) certificate files in PEM format. 8.0.23
--server-ssl-cipher SSL Cipher for Server 8.0.23
--server-ssl-crl The path to the file containing the certificate revocation lists in PEM format 8.0.23
--server-ssl-crlpath The path to the directory that contains the certificate revocation list files in PEM format 8.0.23
--server-ssl-curves SSL Curves for Server 8.0.23
--server-ssl-mode Controls if connections from router to server must be encrypted. 8.0.23
--server-ssl-verify Verification of the SSL certificates presented to the router by the server 8.0.23
--ssl-ca Path to SSL Certificate Authority file to verify server's certificate against
--ssl-capath Directory that contains trusted SSL Certificate Authority certificate files
--ssl-cert The client-side SSL certificate to facilitate client-side authentication during bootstrap
--ssl-cipher A colon-separated list of SSL ciphers to allow, if SSL is enabled
--ssl-crl Path to SSL CRL file to use when verifying server certificate
--ssl-crlpath Path to directory containing SSL CRL files to use when verifying server certificate
--ssl-key The private SSL key to facilitate client-side authentication during bootstrap
--ssl-mode Desired security state when connecting to the metadata server during bootstrap and normal operation. Analogous to --ssl-mode in mysql client
--tls-version Comma-separated list of TLS versions to request, if SSL is enabled

Table 4.5 Windows Services Options

Option Name Description
--clear-all-credentials Clear all stored credentials
--install-service Install MySQL Router as service and set it to automatically start when Windows restarts; service name defaults to MySQLRouter (Windows only)
--install-service-manual Install MySQL Router as service that can be manually started; service name defaults to MySQLRouter (Windows only)
--remove-credentials-section Remove a section's credentials
--remove-service Remove MySQL Router as a Windows service; service name defaults to MySQLRouter
--service Start MySQL Router as a Windows service
--update-credentials-section Update a section's credentials

mysqlrouter Option Descriptions