MYSQLROUTER(1)
MYSQLROUTER(1) π
okay bestie, welcome to the MySQL Router manual page β yep, the whole MySQL Router situation, section 1 of the manual, and it's literally a whole vibe. buckle up π
β¨ NAME β¨
mysqlrouter β MySQL Router, the icon herself π
πΈ SYNOPSIS πΈ
mysqlrouter [options]
π¦ DESCRIPTION π¦
so first up, there's like a little table of contents moment:
- mysqlrouter Option Summaries
- mysqlrouter Option Descriptions
MySQL Router takes command line options that get passed into mysqlrouter to affect how it behaves, or to bootstrap router based on an InnoDB Cluster. lowkey powerful.
When you're 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. cute, flexible, we love options π
Bootstrapping command line options affect the generated files and directories that are used when starting MySQL Router. and yeah, the original does that funny run-together thing β mysqlrouter Option Summariesmysqlrouter Option Descriptions β that's not a typo bestie, that's just how it is π
π --version, -V
Command-Line Format: --version , -V
Displays the version number and related information of the application, and exits. For example:
$> mysqlrouter --version
MySQL Router v9.7.0 on Linux (64-bit) (GPL community edition)
slay, short and sweet β¨
π --help, -?
Command-Line Format: --help , -?
Display help and informative information, and exit.
okay so the --help option has an added benefit β a little bonus feature, if you will. Along with the explanation of each of the options, --help also displays the paths used to find the configuration file, and also several default paths. iconic behavior honestly π
The following excerpt of the --help output shows an example from a Ubuntu 16.04 machine:
$> mysqlrouter --help
...
Start MySQL Router.
Configuration read from the following files in the given order (enclosed
in parentheses means not available for reading):
(/etc/mysqlrouter/mysqlrouter.conf)
/home/philip/.mysqlrouter.conf
Plugin Path:
/usr/lib/x86_64-linux-gnu/mysqlrouter
Default Log Directory:
/var/log/mysqlrouter
Default Persistent Data Directory:
/var/lib/mysqlrouter
Default Runtime State Directory:
/run/mysqlrouter
Usage: mysqlrouter [-V|--version] [-?|--help]
...
The configuration section shows the order for the paths that may be used for reading the configuration file. in this case, only the second file is accessible. the way that little parentheses detail tells you everything π«Ά
π --bootstrap URI, -B URI
Command-Line Format: --bootstrap URI, -B URI
Type: String
okay this is the main character option, fr fr. The main option to perform a bootstrap of MySQL Router by connecting to the InnoDB Cluster metadata server at the URI provided. MySQL Router configures itself based on the information retrieved from the InnoDB Cluster metadata server. A password is prompted for if needed. If a username is not provided as part of the URI then the default user name "root" is used. See Connecting Using URI-Like Connection Strings[1] for information on using a path to specify a server instance.
Note π While--bootstrapaccepts a URI for TCP/IP connections, using the--bootstrap-socketoption with a local Unix domain socket name replaces the"host:port"part of the URI passed to the--bootstrapoption with the socket on the same machine.
By default, the bootstrap process performs a system-wide configuration of MySQL Router. Only one instance of MySQL Router can be configured for system-wide operation. The system instance of MySQL Router has a router_name of "system". If additional instances are desired, use the --directory option to create self-contained MySQL Router installations. one at a time for the system, that's the rule π¨
URI: a server instance from an InnoDB Cluster to fetch metadata information from. If the provided URI is a read-only instance, MySQL Router automatically reconnects to a read-write instance in the InnoDB Cluster so it can register MySQL Router. it literally finds a way π
If a configuration file already exists when you start MySQL Router with the --bootstrap, the existing router_id in that file is reused, and a reconfiguration process occurs. The configuration file is regenerated from scratch and the MySQL Router's metadata server account is recreated, although with the same name.
During the reconfiguration process, all changes made to an existing configuration file are discarded. π so if you hand-edited stuff, it's gone β to customize a configuration file and still retain the ability of automatic reconfiguration (bootstrapping), you can use the --extra-config command line option to specify an additional configuration file that is read after the main configuration file. These configuration options are used because this extra configuration file is loaded after the main configuration file. order matters, bestie π
The bootstrap process creates a new MySQL user account with a randomly generated password to use by that specific MySQL Router instance. This account is used by MySQL Router when connecting to the metadata server and InnoDB cluster to fetch information about its current state. For detailed information about this user including how its password is stored and the MySQL privilege it requires, see documentation for the MySQL user option.
The generated configuration file is named mysqlrouter.conf, and its location depends on the type of instance being configured, the system, and the package. For system-wide installations, the generated configuration file is added to the system's configuration directory such as /etc or %PROGRAMDATA%\MySQL\MySQL Router\. Executing mysqlrouter --help will display this location. so that's why the help output is doing the most β it's telling you where your stuff lives β¨
The --user option is required if executing a bootstrap with a super user (uid=0). Although not recommended, forcing the super user is possible by passing its name as an argument such as --user=root. not recommended, for real β consider yourself warned π©
The minimum GRANT permissions required to execute --bootstrap are:
GRANT CREATE USER ON *.* TO 'bootstrapuser'@'%' WITH GRANT OPTION;
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON mysql_innodb_cluster_metadata.* TO 'bootstrapuser'@'%';
GRANT SELECT ON mysql.user TO 'bootstrapuser'@'%';
GRANT SELECT ON performance_schema.replication_group_members TO 'bootstrapuser'@'%';
GRANT SELECT ON performance_schema.replication_group_member_stats TO 'bootstrapuser'@'%';
GRANT SELECT ON performance_schema.global_variables TO 'bootstrapuser'@'%';
Using --bootstrap adds default values to the generated MySQL Router configuration file, and some of these default values depend on other conditions. Listed below are some of the conditions that affect the generated default values, where default is defined by passing in --bootstrap by itself. iykyk π
...
more parts coming, bestie β don't go anywhere π¦
Table 4.2. Conditions that affect default --bootstrap values β bestie, this is the cheat sheet for what actually changes those generated defaults π
--conf-base-portβ modifies the generatedbind_portvalues for each connection type. By default, generatedbind_portvalues work like this: for the classic protocol, Read-Write uses6446and Read-Only uses6447, and for the X protocol Read-Write uses6448and Read-Only uses6449. Setting--conf-base-portto0changes the defaultbind_portvalues to these defaults: for the classic protocol, Read-Write uses6446and Read-Only uses6447, and for the X protocol Read-Write uses64460and Read-Only uses64470. (yes those numbers are real, don't come for me π)--conf-use-socketsβ inserts socket definitions for each connection type.--conf-skip-tcpβ TCP/IP connection definitions are not defined.--directoryβ affects all file paths, and also generates additional files.- Other β this list is not exhaustive, other options and conditions also affect the generated values.
--bootstrap-socketsocket_name β the Unix-socket glow-up for bootstrapping π- Command-Line Format:
--bootstrap-socket socket_name - Platform Specific: Linux
- Command-Line Format:
Used in conjunction with --bootstrap to bootstrap using a local Unix domain socket instead of TCP/IP. The --bootstrap-socket value replaces the "host:port" part in the --bootstrap definition with the assigned socket name for connecting to the MySQL metadata server using Unix domain sockets. This is the MySQL instance that is being bootstrapped from, and this instance must be on the same machine if sockets are used. For additional details about how bootstrapping works, see --bootstrap.
Heads up: this option is different than the --conf-use-sockets command line option that sets the socket configuration file option during the bootstrap process. Two different things, don't mix them up π«Ά
This option is not available on Windows.
--core-fileβ for whenmysqlrouterdies and you want the receipts π- Command-Line Format:
--core-file[={0|1}] - Type: Boolean
- Default Value:
0
- Command-Line Format:
Write a core file if mysqlrouter dies. The name and location of the core file is system dependent. On Linux, a core file named core.pid is written to the current working directory of the process. pid represents the process ID of the server process. On macOS, a core file named core.pid is written to the /cores directory, if the process has the com.apple.security.get-task-allow entitlement. On Solaris, use the coreadm command to specify where to write the core file and how to name it. On Windows, a minidump file named mysqlrouter.{pid}.dmp is written to the current working directory of the process.
--directorydir_path,-ddir_path β your own lil self-contained Router world π- Command-Line Format:
--directory dir_path, -d dir_path - Type: String
- Command-Line Format:
Specifies that a self-contained MySQL Router installation will be created at the defined directory instead of configuring the system-wide router instance. This also allows multiple router instances to be created on the same system. Slay, multitasking icon behavior β¨
The self-contained directory structure for Router is:
$path/start.sh
$path/stop.sh
$path/mysqlrouter.pid
$path/mysqlrouter.conf
$path/mysqlrouter.key
$path/run
$path/run/keyring
$path/data
$path/log
$path/log/mysqlrouter.log
If this option is specified, the keyring file is stored under the runtime state directory of that instance, under run/ in the specified directory, as opposed to the system-wide runtime state directory.
If --conf-use-sockets is also enabled then the generated socket files are also added to this directory. Cozy.
--master-key-writerfile_path β hand off your master key to a script, very main character of you π- Command-Line Format:
--master-key-writer file_path - Type: String
- Command-Line Format:
This optional bootstrap option accepts a script that reads the master key from STDIN. It also uses the ROUTER_ID environment variable set by MySQL Router before the master-key-writer script is called.
Themaster-key-writerandmaster-key-readeroptions must be used together, and using them means themaster_key_fileoption must not be defined inmysqlrouter.confas the master key is not written to themysqlrouter.keymaster key file. That's a hard rule, not a vibe suggestion π
This is also written to the generated MySQL Router configuration file as the master-key-writer [DEFAULT] option.
Example contents of a bash script named writer.sh used in our example:
#!/bin/bash
KID_=$(keyctl padd user ${ROUTER_ID} @us <&0)
Example usage:
$> mysqlrouter --bootstrap=127.0.0.1:3310 --master-key-reader=./reader.sh
--master-key-writer=./writer.sh
This also affects the generated mysqlrouter.conf, for example:
[DEFAULT]
...
master-key-reader=reader.sh
master-key-writer=writer.sh
--master-key-readerβ a bootstrap option (optional btw, you don't have to) that takes a script which writes the master key to STDOUT. β¨ It also makes use of theROUTER_IDenvironment variable, which MySQL Router sets before your master-key-reader script gets called.- Command-Line Format:
--master-key-reader file_path - Type: String
- Command-Line Format:
Okay so listen bestie, the master-key-reader and master-key-writer options must be used together, and using them means the master_key_file option must not be defined in mysqlrouter.conf. Why? Because the master key is not written to the mysqlrouter.key master key file in that case β instead it uses the value provided by this option's script. π
This is also written to the generated MySQL Router configuration file as the master-key-reader [DEFAULT] option.
Example contents of a bash script named reader.sh, used in our example:
#!/bin/bash
KID_=$(keyctl search @us user ${ROUTER_ID} 2>/dev/null)
if [ ! -z $KID_ ]; then
keyctl pipe $KID_
fi
Example usage:
$> mysqlrouter --bootstrap=127.0.0.1:3310 --master-key-reader=./reader.sh
# Or, multiple hosts--master-key-writer=./writer.sh
This also affects the generated mysqlrouter.conf, for example:
[DEFAULT]
...
master-key-reader=reader.sh
master-key-writer=writer.sh
--strictβ turns on strict mode π«Ά Which for example causes the bootstrap--accountuser verification check to stop the bootstrap process rather than only emit a warning and continue if the supplied user does not pass the check. Like, no more "eh whatever, keep going" energy.- Command-Line Format:
--strict - Type: String
- Command-Line Format:
--accountβ a bootstrap option to specify the MySQL user to use, which either reuses an existing MySQL user account or creates one. Behavior is controlled by the related--account-createoption. πΈ- Command-Line Format:
--account username - Type: String
- Command-Line Format:
With --account, usage favors ease of management over ease of deployment, because multiple routers may share the same account, and the username and password are manually defined rather than auto-generated. iykyk.
Setting this option triggers a password prompt for this account regardless of whether the password is available in the keyring. π
Bootstrapping without passing --account does not recreate an existing MySQL server account.
Using this option assumes the user has sufficient access rights for Router, because the bootstrap process does not attempt to add missing grants to existing accounts. The bootstrap process does verify the permissions and outputs information to the console of the failed check. The bootstrap process continues despite these failed checks unless the optional --strict option is also used. Example required permissions:
GRANT USAGE ON *.* TO `theuser`@`%`
GRANT SELECT, EXECUTE ON `mysql_innodb_cluster_metadata`.* TO `theuser`@`%`
GRANT INSERT, UPDATE, DELETE ON `mysql_innodb_cluster_metadata`.`routers` TO `theuser`@`%`
GRANT INSERT, UPDATE, DELETE ON `mysql_innodb_cluster_metadata`.`v2_routers` TO `theuser`@`%`
GRANT SELECT ON `performance_schema`.`global_variables` TO `theuser`@`%`
GRANT SELECT ON `performance_schema`.`replication_group_member_stats` TO `theuser`@`%`
GRANT SELECT ON `performance_schema`.`replication_group_members` TO `theuser`@`%`
A password is not accepted from the command-line. For example, passing in"foo:bar"assumes"foo:bar"is the desired username rather than userfoowith the passwordbar. π Do not do that.
--account-createβ specify the account creation policy, which helps guard against accidentally bootstrapping with the wrong user account. Very "protect yourself" of it. π- Command-Line Format:
--account-create behavior - Type: String
- Default Value:
if-not-exists - Valid Values:
if-not-exists,always,never
- Command-Line Format:
Potential values are:
if-not-exists(default): Bootstrap either way; reuse the account if it exists, otherwise create it.always: Only bootstrap if the account does not already exist; and create it.never: Only bootstrap if the account already exists; and reuse it.
This option requires that the --account option is also used, and that --account-host is not used. β
--account-hostβ the host pattern used for accounts created by MySQL Router during the bootstrap process. This is optional and defaults to%. π- Command-Line Format:
--account-host host_pattern - Type: String
- Default Value:
%
- Command-Line Format:
Pass in this option multiple times to define multiple patterns, in which case the generated MySQL accounts use the same password.
Note: Router does not perform sanity checking and does not ensure that the pattern authorizes Router to connect. π
Note: Bootstrapping reuses existing Router accounts by dropping and recreating the user, and this user recreation process applies to every host. π
Examples:
# One host
$> mysqlrouter --bootstrap localhost:3310 --account-host host1
# Or, multiple hosts
$> mysqlrouter --bootstrap localhost:3310 --account-host host1 --account-host host2
--account-host host3
--conf-use-socketsβ enables local Unix domain sockets. π¦- Command-Line Format:
--conf-use-sockets - Platform Specific: Linux
- Command-Line Format:
This option is used while bootstrapping, and enabling it adds the socket option to the generated configuration file.
The name of the generated socket file depends on the protocol option. With the classic protocol enabled, the file is named mysql.sock for read-write connections, and mysqlro.sock for read-only connections. With the X Protocol enabled, the file is named mysqlx.sock for read-write connections, and mysqlxro.sock for read-only connections.
This option is not available on Windows. Sorry Windows besties. π
--conf-use-gr-notificationsβ enables theuse_gr_notifications[metadata_cache]option during bootstrap. When enabled, Router is asynchronously notified about most cluster changes. Seeuse_gr_notificationsfor more information. In addition, using this option setsttl=60andauth_cache_refresh_interval=60. π₯- Command-Line Format:
--conf-use-gr-notifications
- Command-Line Format:
--pid-file pathβ the pid file path option, literally right here in the list, giving "to be continued" energy π§- Command-Line Format:
--pid-file path - Type: String
- Command-Line Format:
Sets where the PID file lives, bestie. And there are like, three ways to set it β in order of precedence: this --pid-file command-line option, then setting pid_file in Router's configuration file, or defining the ROUTER_PID environment variable.
Okay so heads up: if --bootstrap is specified, then setting --pid-file makes Router literally fail. Which is not like ROUTER_PID and the pid_file configuration option, because those two just get ignored when --bootstrap is specified. Different energy entirely, iykyk.
And if --bootstrap is not specified, then these things make Router fail: the --pid-file already exists, pid_file or ROUTER_PID are set but empty, or Router just can't write the PID file. That's it, that's the list π«Ά
--report-hostβ optionally define Router's hostname instead of relying on auto-detection to figure out the externally visible hostname registered to metadata during the bootstrap process- Command-Line Format:
--report-host hostname - Type:
String - Router does not check or confirm that the supplied hostname is reachable β no vibe check, no nothing β but it does use RFC 1123 to validate host names, and RFC 2181 to validate addresses
- The supplied hostname gets written to the
host_namefield of themysql_innodb_cluster_metadata.hoststable in the MySQL InnoDB cluster metadata store
- Command-Line Format:
--conf-skip-tcpβ skips configuration of a TCP port for listening to incoming connections. See also--conf-use-sockets- Command-Line Format:
--conf-skip-tcp - Platform Specific:
Linux - This option is not available on Windows πͺ
- Command-Line Format:
--conf-base-port port_numβ the base (first) value used for the listening TCP ports, set by settingbind_portfor each bootstrapped route- Command-Line Format:
--conf-base-port port_num - Type:
Integer - Default Value:
0 - This value is used for the classic read-write route, and each additional allocated port gets incremented by a value of one. The port order set is classic read-write / read-only, and then x read-write / read-only
- Setting
--conf-base-portto0changes the defaultbind_portvalues to the following defaults, which were as follows: for the classic protocol, Read-Write uses6446and Read-Only uses6447, and for the X protocol Read-Write uses64460and Read-Only uses64470 - Example usage, and yes we're copying it exactly:
- Command-Line Format:
# Example without --conf-base-port
$> mysqlrouter --bootstrap root@localhost:3310
...
Classic MySQL protocol connections to cluster 'devCluster':
- Read/Write Connections: localhost:6446
- Read/Only Connections: localhost:6447
X protocol connections to cluster 'devCluster':
- Read/Write Connections: localhost:6448
- Read/Only Connections: localhost:6449
# Example demonstrating --conf-base-port set to 0
$> mysqlrouter --bootstrap root@localhost:3310 --conf-base-port 0
...
Classic MySQL protocol connections to cluster 'devCluster':
- Read/Write Connections: localhost:6446
- Read/Only Connections: localhost:6447
X protocol connections to cluster 'devCluster':
- Read/Write Connections: localhost:64460
- Read/Only Connections: localhost:64470
--conf-bind-address addressβ modifies thebind_addressvalue set by--bootstrapin the generated Router configuration file. By default, bootstrapping setsbind_address=0.0.0.0for each route, and this option changes that value- Command-Line Format:
--conf-bind-address address - Type:
String - Default Value:
0.0.0.0
- Command-Line Format:
Note β¨ the defaultbind_addressvalue is127.0.0.1ifbind_addressis not defined. Slight plot twist, but we move.
--read-timeout num_secondsβ number of seconds before read operations to a metadata server are considered timed out- Command-Line Format:
--read-timeout num_seconds - Type:
Integer - Default Value:
30 - This affects read operations during both the bootstrap process, and it also affects normal MySQL Router operations by setting the associated
read_timeoutoption in the generatedmysqlrouter.conf - This option is set under the
[DEFAULT]namespace
- Command-Line Format:
--connect-timeout num_secondsβ number of seconds before connection attempts to a metadata server are considered timed out- Command-Line Format:
--connect-timeout num_seconds - Type:
Integer - Default Value:
30 - This affects connections during both the bootstrap process, and also affects normal MySQL Router operations by setting the associated
connect_timeoutoption in the generatedmysqlrouter.conf - There are two
connect_timeoutvariants, okay bestie, don't mix them up: the metadata server variant is defined under the[DEFAULT]namespace, while the MySQL server variant is defined under the[routing]namespace
- Command-Line Format:
--user {user_name|user_id},-u {user_name|user_id}β runmysqlrouteras the user having the name user_name or the numeric user ID user_id. "User" in this context refers to a system login account, not a MySQL user listed in the grant tables. When bootstrapping, all generated files are owned by this user, and this also sets the associateduseroption- Command-Line Format:
--user {user_name|user_id},-u {user_name|user_id} - Platform Specific:
Linux - Type:
String - This system user is defined in the configuration file under the
[DEFAULT]namespace. For additional information, see theuseroption's documentation that--userconfigures - The
--useroption is required if executing a bootstrap as a super user (uid=0). Although it's not recommended, forcing the super user is possible by passing its name as an argument, such as--user=root. Likeβ¦ you can, but bestie, think about it first π - This option is not available on Windows πͺ
- Command-Line Format:
--name router_nameβ Command-Line Format:--name router_name, Type:String, Default Value:system--name nameβ On initial bootstrap, this gives your self-contained Router instance a symbolic name. It's optional, and it's used with--directory. When you're creating multiple instances, the names must be unique β no twinning, bestie π--force-password-validation- Command-Line Format:
--force-password-validation - Platform Specific: Linux
- By default, MySQL Router skips the MySQL Server's
validate_passwordmechanism and instead generates and uses aSTRONGpassword based on knownvalidate_passworddefault settings. Why? Becausevalidate_passwordcan be configured by the user, and Router can't take unusual custom settings into account π - This option makes sure password validation (
validate_password) is not skipped for generated passwords. It is disabled by default.
- Command-Line Format:
--password-retries num_retries- Command-Line Format:
--password-retries num_retries - Type: Integer
- Default Value:
20 - Minimum Value:
1 - Maximum Value:
10000 - Specifies how many times MySQL Router should attempt to generate a password when creating a user account with the password validation rules. The default value is
20. The valid range is1to10000. - The most likely reason for failure is custom
validate_passwordsettings with unusual requirements, such as a50character minimum. In that fail scenario, it is likely that--force-password-validationis set totrue.
- Command-Line Format:
--force- Command-Line Format:
--force - Force a reconfiguration over a previously configured router instance on the host. Like, override the old setup, no cap π₯
- Command-Line Format:
--ssl-mode mode- Command-Line Format:
--ssl-mode mode - Type: String
- Default Value:
PREFERRED - Valid Values:
PREFERRED,DISABLED,REQUIRED,VERIFY_CA,VERIFY_IDENTITY - SSL connection mode for use during bootstrap and normal operation when connecting to the metadata server. Analogous to
--ssl-modein themysqlclient. - During bootstrap, all connections to metadata servers made by the Router will use the SSL options specified. If
ssl_modeis not specified in the configuration, it will default toPREFERRED. During normal operation, after Router is launched, its Metadata Cache plugin will read and honor all configured SSL settings. - When set to a value other than the default (
PREFERRED), anssl_modeentry is inserted under[metadata_cache]in the generated configuration file. - Available values are
DISABLED,PREFERRED,REQUIRED,VERIFY_CA, andVERIFY_IDENTITY.PREFERREDis the default value. As with themysqlclient, this value is case-insensitive. - The configuration file equivalent is documented separately at
ssl_mode.
- Command-Line Format:
--ssl-cert file_path- Command-Line Format:
--ssl-cert file_path - Type: String
- Default Value: (empty)
- The path name of the SSL public key certificate file in PEM format. This is used to facilitate client-side authentication during the bootstrap process. This directly matches and uses functionality of the MySQL client's
--ssl-certoption. - Like
--ssl-key, this option is only used during bootstrap that uses a root account. It is useful when the root account was created withREQUIRE X509, and therefore logging in as root requires the client to authenticate itself π«Ά
- Command-Line Format:
--ssl-key file_path- Command-Line Format:
--ssl-key file_path - Type: String
- The path name of the SSL private key file in PEM format. This is used to facilitate client-side authentication during the bootstrap process. This directly matches and uses functionality of the MySQL client's
--ssl-keyoption. - Like
--ssl-cert, this option is only used during a bootstrap process that uses a root account. It is useful when the root account was created withREQUIRE X509, and therefore logging in as root requires the client to authenticate itself.
- Command-Line Format:
--ssl-cipher ciphers- Command-Line Format:
--ssl-cipher ciphers - Type: String
- Default Value: (empty)
- A colon-separated (
":") list of SSL ciphers to allow, if SSL is enabled.
- Command-Line Format:
--tls-version versions- Command-Line Format:
--tls-version versions - Type: String
- Default Value: (empty)
- A comma-separated (
",") list of TLS versions to request, if SSL is enabled.
- Command-Line Format:
--ssl-ca file_path- Command-Line Format:
--ssl-ca file_path - Type: String
- Default Value: (empty)
- Path to the SSL CA file to verify a server's certificate against.
- Command-Line Format:
--ssl-capath dir_pathβ Path to directory containing the SSL CA files to verify a server's certificate against. π- Command-Line Format:
--ssl-capath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--ssl-crl file_pathβ Path to the SSL CRL file to use when verifying a server's certificate. π¦- Command-Line Format:
--ssl-crl file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--ssl-crlpath dir_pathβ Path to the directory containing SSL CRL files to use when verifying a server's certificate. π- Command-Line Format:
--ssl-crlpath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--client-ssl-mode modeβ SSL connection mode for use during bootstrap and normal operation when connecting between MySQL Router and client. β¨- Command-Line Format:
--client-ssl-mode - Type: String
- Default Value:
PREFERRED - Valid Values:
PREFERRED,DISABLED,PASSTHROUGH,REQUIRED
- Command-Line Format:
During bootstrap, all connections to clients made by the Router will use the SSL options specified. If client_ssl_mode is not specified in the configuration, it defaults to PREFERRED. π«Ά
The configuration file equivalent is documented separately at client_ssl_mode. π
--client-ssl-cert file_pathβ The path name of the SSL public key certificate file in PEM format. This is used to facilitate client-side authentication during the bootstrap process. π- Command-Line Format:
--client-ssl-cert file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
Like --client-ssl-key, this option is only used during bootstrap that uses a root account. It is useful when the root account was created with REQUIRE X509, and therefore logging in as root requires the client to authenticate itself. π
client-ssl-curvesβ Defaults to a secure list of SSL curves. Format this string as a colon separated list of curve names. πΈ- Command-Line Format:
--client-ssl-curves - Type: String
- Command-Line Format:
--client-ssl-key file_pathβ The path name of the SSL private key file in PEM format. This is used to facilitate client-side authentication during the bootstrap process. π¦- Command-Line Format:
--client-ssl-key file_path - Type: String
- Command-Line Format:
Like --client-ssl-cert, this option is only used during a bootstrap process that uses a root account. It is useful when the root account was created with REQUIRE X509, and therefore logging in as root requires the client to authenticate itself. π₯
--client-ssl-cipher ciphersβ A colon-separated (:) list of SSL ciphers to allow, if SSL is enabled. π- Command-Line Format:
--client-ssl-cipher - Type: String
- Command-Line Format:
client-ssl-dh-paramsβ Filename of the DH parameter file. If specified and not empty, the DH parameters from this file are used instead of internal default DH parameters. Format the DH param file in PEM format. π- Command-Line Format:
--client-ssl-dh-params=filepath - Type: String
- Command-Line Format:
--client-ssl-ca file_pathβ Path to the SSL CA file to verify a server's certificate against. π- Command-Line Format:
--client-ssl-ca file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--client-ssl-capath dir_pathβ Path to directory containing the SSL CA files to verify a server's certificate against. π- Command-Line Format:
--client-ssl-capath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--client-ssl-crl file_pathβ the path to the SSL CRL file to use when verifying a server's certificate. π- Command-Line Format:
--client-ssl-crl file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--client-ssl-crlpath dir_pathβ path to the directory that's holding your SSL CRL files, used when verifying a server's certificate. like same vibe as the one above but it's giving "folder" instead of "file" β¨- Command-Line Format:
--client-ssl-crlpath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
πΈ the server-side ssl era πΈ
--server-ssl-mode modeβ the SSL connection mode used during bootstrap and normal operation, when MySQL Router is connecting to a server. π- Command-Line Format:
--server-ssl-mode - Type: String
- Default Value:
PREFERRED - Valid Values:
AS_CLIENTDISABLEDPREFERREDREQUIRED
- Command-Line Format:
okay so here's the tea: during bootstrap, every connection the Router makes to servers uses the SSL options you specified. and if server_ssl_mode isn't specified in the configuration, it defaults to PREFERRED, no cap.
the config-file equivalent of this one is documented separately, over at server_ssl_mode β go look there for that flavor π«Ά
--server-ssl-cipher ciphersβ a colon-separated (":") list of the SSL ciphers you're allowing, if SSL is enabled. that's it, that's the whole thing π¦- Command-Line Format:
--server-ssl-cipher - Type: String
- Command-Line Format:
--server-ssl-ca file_pathβ path to the SSL CA file you verify a server's certificate against. π₯- Command-Line Format:
--server-ssl-ca file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--server-ssl-capath dir_pathβ path to the directory containing the SSL CA files you verify a server's certificate against. π- Command-Line Format:
--server-ssl-capath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--server-ssl-crl file_pathβ path to the SSL CRL file to use when verifying a server's certificate. π- Command-Line Format:
--server-ssl-crl file_path - Type: String
- Default Value: (empty)
- Command-Line Format:
--server-ssl-crlpath dir_pathβ path to the directory containing SSL CRL files to use when verifying a server's certificate. π- Command-Line Format:
--server-ssl-crlpath dir_path - Type: String
- Default Value: (empty)
- Command-Line Format:
server-ssl-curvesβ defaults to a secure list of SSL curves, bestie, we don't do insecure here. format the string as a colon-separated list of curve names and you're golden π- Command-Line Format:
--server-ssl-curves - Type: String
- Command-Line Format:
ngl, the manpage writes this one without the leading--in the option list but the Command-Line Format says--server-ssl-curves. iykyk, keep both in mind π§
--server-ssl-verify stringβ verification of the SSL certificates that the server presents to the Router. this is the vibe check for certificates, periodt. π- Command-Line Format:
--server-ssl-verify - Type: String
- Default Value:
DISABLED - Valid Values:
DISABLEDVERIFY_CAVERIFY_IDENTITY
- Command-Line Format:
and what each one means, because this part actually matters:
DISABLED: the connection fails if the server doesn't provide a certificate in the handshake. πVERIFY_CA: the connection fails if the server's certificate doesn't match a CA trusted by MySQL Router. π¦VERIFY_IDENTITY: the connection fails if the server's certificate doesn't match a CA trusted by MySQL Router, or if the server certificate's subject doesn't match the hostname or IP address that MySQL Router connected to. highkey the strictest one π
okay so weβre still deep in the option menu, and these next ones are giving config-file glow-up and Windows-service realness π
--config file_path,-c file_pathβ bestie, this is your βmy config file is not in the usual spotβ button. It gives Router a path and file name for the configuration file to use. Use it when you want a config file located in a folder other than the default locations. π Command-Line Format:--config file_path, -c file_pathWhen itβs used with--bootstrap, and the configuration file already exists, a copy of the current file is saved with a.bakextension if the generated configuration file contents is different than the original. Existing.bakfiles are overwritten. no cap, they really do get overwritten.--extra-config file_path,-a file_pathβ this one gives you an optional, additional configuration file to use. Reach for it if you want to split the configuration file into two parts for testing, multiple instances of the application running on the same machine, etc. π Command-Line Format:--extra-config file_path, -a file_pathThis configuration file is read after the main configuration file. If there are conflicts β like an option is set in multiple configuration files β values from the file that is loaded last is used.--install-serviceβ Windows only, bestie. πͺ Command-Line Format:--install-service [service_name]Platform Specific: Windows It installs Router as a Windows service that automatically starts when Windows starts. The service name defaults toMySQLRouter. This installation process does not validate configuration files passed in via--config. π This option is only available on Windows.--install-service-manualβ also Windows only, and itβs giving βyou start me yourselfβ energy. β¨ Command-Line Format:--install-service-manual [service_name]Platform Specific: Windows It installs MySQL Router as a Windows service that can be manually started. The service name defaults toMySQLRouter. This option is only available on Windows.--remove-serviceβ Windows only, and yes, it removes the Router Windows service. π Command-Line Format:--remove-service [service_name]Platform Specific: Windows The service name defaults toMySQLRouter. This option is only available on Windows.--serviceβ Windows only, and it starts Router as a Windows service. π Command-Line Format:--servicePlatform Specific: Windows This is a private option, meaning it is only meant to be used by the Windows Service when launching Router as a service. This option is only available on Windows.--update-credentials-sectionβ Windows only, and itβs about the Windows password vault. π«Ά Command-Line Format:--update-credentials-section section_namePlatform Specific: Windows This option is only available on Windows, and refers to its password vault.--conf-target-clusterβ sets thetarget_clustermetadata MySQL Router option. π¦ Command-Line Format:--conf-target-cluster valueType: String Valid Values:current,primary
It accepts one of these strings:
current: setstarget_clusterto the cluster containing the node being bootstrapped against. It defines it as the clusterβs UUID value. If this is also the Primary, it does not dynamically follow role changes like the primary does; instead it remains static.primary: setstarget_clusterto the primary cluster, including when it changes at runtime.
See also --config-target-cluster-by-name, which sets the target_cluster to a specific static cluster name.
Note β Bootstrapping against aClusterSet[2]requires thecluster_typeRouter configuration option set togr. β
--conf-set-optionβ this bad boy sets a value for a generated configuration option during bootstrap. You can set a value for any bootstrapped option, for example: π₯ Command-Line Format:--conf-set-option section_name[:optional_section_key].option=valueType: String
$> mysqlrouter -B 127.0.0.1:5000 \
--directory=dir1 \
--conf-set-option=logger.level=debug \
--conf-set-option=routing:test_rw.max_connect_errors=0 \
--conf-set-option=routing:test_ro.max_connect_errors=0
Those commands alter the default values for those specific options by defining them as such:
[logger]
level=debug
[routing:test_rw]
...
max_connect_errors=0
...
[routing:test_ro]
...
max_connect_errors=0
...
--conf-set-option definitions take precedence over option specific parameters to set specific value. For example, if both --connect-timeout=X and --conf-set-option=DEFAULT.connect_timeout=Y are specified when bootstrapping, the connect_timeout is set to Y in the generated configuration file. periodt.
--conf-target-cluster-by-nameβ sets thetarget_clustermetadata MySQL Router option to a specific cluster name. πΈ Command-Line Format:--conf-target-cluster-by-name clusterNameType: String
Or, instead use --conf-target-cluster to assign a dynamic cluster type, such as primary. π
--remove-credentials-section section_nameβ yeets the credentials for a given section out of existence π- Command-Line Format:
--remove-credentials-section section_name - Platform Specific: Windows
- Command-Line Format:
This one is Windows-only bestie, and it's talking about the Windows password vault, okay? It removes the credentials for whatever section you name. That's it, that's the whole vibe.
--clear-all-credentialsβ nukes everything in the password vault, like a full factory reset but for stored credentials π- Command-Line Format:
--clear-all-credentials - Platform Specific: Windows
- Command-Line Format:
Clears the password vault by removing all credentials stored in it. Again: Windows-only, and again it's the Windows password vault we're talking about. No survivors, periodt.
--disable-restβ tells bootstrap not to write the REST API web service config into your generatedmysqlrouter.confπ- Command-Line Format:
--disable-rest
- Command-Line Format:
Okay so by default, config details for the MySQL Router REST API web service functionality get added to the generated mysqlrouter.conf file at bootstrap β and this parameter means those details are not added. And before you panic: this does not disable REST API functionality itself, because you can manually configure the REST API (to enable it) later on. It's giving "not now" not "never", iykyk β¨
--https-portβ pick the HTTP server port for the REST API under[http_server]in the generatedmysqlrouter.confπ₯- Command-Line Format:
--https-port value - Type: Integer
- Default Value:
8443 - Minimum Value:
1 - Maximum Value:
65535
- Command-Line Format:
Optionally define the HTTP server's port for the MySQL Router REST API under the [http_server] section in generated mysqlrouter.conf at bootstrap. It defaults to 8443. And heads up: availability of the port is not checked. Nobody's knocking on that door to see if anyone's home, so pick wisely bestie π«Ά
π COPYRIGHT π
Copyright Β© 2006, 2026, Oracle and/or its affiliates.
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
Fr fr read the license, it's the main character of this section π
π NOTES π
- Connecting Using URI-Like Connection Strings
https://dev.mysql.com/doc/refman/9.7/en/connecting-using-uri-or-key-value-pairs.html#connecting-using-uri - ClusterSet
https://dev.mysql.com/doc/mysql-shell/9.7/en/innodb-clusterset.html
π¦ AUTHOR π¦
Oracle Corporation (http://dev.mysql.com/).
And that's the whole page, bestie β you ate that π
β¨ This one's from MySQL 9.7, dated 06/24/2026, and it's MYSQLROUTER(1) all day. Go configure something iconic ππ
π¦ where this page comes from
- arch rolling: percona-server 9.7.2_2-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms