MYSQLROUTER(1) MySQL Router MYSQLROUTER(1) (NAME) mysqlrouter - MySQL (SYNOPSIS) mysqlrouter [options] (DESCRIPTION) o mysqlrouter o mysqlrouter MySQL Router mysqlrouter InnoDB Cluster (bootstrap) . Router --config ( ) --extra-config . MySQL Router . mysqlrouter mysqlrouter o --version, -V +--------------------+----------------+ | | --version , -V | | | | +--------------------+----------------+ . : $> mysqlrouter --version MySQL Router v9.7.0 on Linux (64-bit) (GPL community edition) o --help, -? +--------------------+-------------+ | | --help , -? | | | | +--------------------+-------------+ . --help . --help . --help 16.04 : $> 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] ... . . o --bootstrap URI, -B URI +--------------------+-------------------------+ | | --bootstrap URI, -B URI | | | | +--------------------+-------------------------+ | | String | +--------------------+-------------------------+ (bootstrap) MySQL Router (metadata server) InnoDB Cluster URI . MySQL Router InnoDB Cluster . . URI <> . Connecting Using URI-Like Connection Strings[1] . --bootstrap URI TCP/IP --bootstrap-socket (Unix domain socket) <> URI --bootstrap . MySQL Router . MySQL Router . MySQL Router router_name <> . --directory MySQL Router . URI: InnoDB Cluster . URI (read- only) MySQL Router - (read-write) InnoDB Cluster MySQL Router . MySQL Router --bootstrap router_id . MySQL Router . . ( ) --extra-config . . MySQL MySQL Router . MySQL Router InnoDB Cluster . MySQL MySQL (MySQL user option) . mysqlrouter.conf . /etc %PROGRAMDATA%\MySQL\MySQL Router\ . mysqlrouter --help . --user / (uid=0) . --user=root . GRANT --bootstrap : 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'@'%'; --bootstrap MySQL Router . --bootstrap . 4.2. --bootstrap +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |--conf-base-port | T{.PP | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |bind_port | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | . | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |bind_port | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | Read-Write 6446 Read-Only 6447 X Read-Write 6448 Read-Only 6449 . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |--conf-base-port | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 0 | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |bind_port | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | Read-Write 6446 Read-Only 6447 X Read-Write 64460 Read-Only 64470 . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |T} | | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |--conf-use-sockets | socket . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |--conf-skip-tcp | TCP/IP . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |--directory | . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | . | +----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ o --bootstrap-socket socket_name +--------------------------+--------------------+ | | --bootstrap-socket | | | socket_name | +--------------------------+--------------------+ | | Linux | | | | +--------------------------+--------------------+ --bootstrap (Unix domain socket) TCP/IP . --bootstrap-socket "host:port" --bootstrap MySQL . MySQL . --bootstrap . --conf-use-sockets socket . Windows . o --core-file +----------------------+---------------------+ | | --core-file[={0|1}] | | | | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | 0 | | | | +----------------------+---------------------+ mysqlrouter core . core . Linux core core.pid . pid (PID) . macOS com.apple.security.get-task-allow core core.pid /cores . Solaris coreadm core . Windows minidump mysqlrouter.{pid}.dmp . o --directory dir_path, -d dir_path +--------------------+--------------------------+ | | --directory dir_path, -d | | | dir_path | +--------------------+--------------------------+ | | | +--------------------+--------------------------+ router MySQL Router . router . Router : $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 keyring run/ . --conf-use-sockets . o --master-key-writer +--------------------+---------------------+ | | --master-key-writer | | | file_path | +--------------------+---------------------+ | | | +--------------------+---------------------+ STDIN . ROUTER_ID master-key-writer MySQL Router . master-key-writer master-key-reader master_key_file mysqlrouter.conf mysqlrouter.key . MySQL Router master-key-writer [DEFAULT] . bash writer.sh : #!/bin/bash KID_=$(keyctl padd user ${ROUTER_ID} @us <&0) : $> mysqlrouter --bootstrap=127.0.0.1:3310 --master-key-reader=./reader.sh --master-key-writer=./writer.sh mysqlrouter.conf : [DEFAULT] ... master-key-reader=reader.sh master-key-writer=writer.sh o --master-key-reader +--------------------+---------------------+ | | --master-key-reader | | | file_path | +--------------------+---------------------+ | | String | +--------------------+---------------------+ (bootstrap) STDOUT . ROUTER_ID master-key-reader MySQL Router . master-key-reader master-key-writer master_key_file mysqlrouter.conf mysqlrouter.key . MySQL Router [DEFAULT] master-key-reader . bash reader.sh : #!/bin/bash KID_=$(keyctl search @us user ${ROUTER_ID} 2>/dev/null) if [ ! -z $KID_ ]; then keyctl pipe $KID_ fi : $> mysqlrouter --bootstrap=127.0.0.1:3310 --master-key-reader=./reader.sh # Or, multiple hosts--master-key-writer=./writer.sh mysqlrouter.conf : [DEFAULT] ... master-key-reader=reader.sh master-key-writer=writer.sh o --strict +--------------------+----------+ | | --strict | | | | +--------------------+----------+ | | String | +--------------------+----------+ (strict mode) --account (bootstrap) . o --account +--------------------+--------------------+ | | --account username | | | | +--------------------+--------------------+ | | String | +--------------------+--------------------+ (bootstrap) MySQL MySQL --account-create . --account router . keyring . --account MySQL . Router . . --strict . : 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`@`%` . "foo:bar" "foo:bar" foo bar. o --account-create +----------------------+---------------------------+ | | --account-create behavior | | | | +----------------------+---------------------------+ | | String | +----------------------+---------------------------+ | | if-not-exists | | | | +----------------------+---------------------------+ | | T{.PP | | | | +----------------------+---------------------------+ |if-not-exists | | +----------------------+---------------------------+ |always | | +----------------------+---------------------------+ |never | | +----------------------+---------------------------+ |T} | | +----------------------+---------------------------+ (bootstrap) . : o if-not-exists (): . o always: . o never: . --account --account-host . o --account-host +----------------------+----------------+ | | --account-host | | | host_pattern | +----------------------+----------------+ | | | +----------------------+----------------+ | | % | | | | +----------------------+----------------+ MySQL Router . '%' . MySQL . Router Router . Router . : # 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 o --conf-use-sockets +--------------------+--------------------+ | | --conf-use-sockets | | | | +--------------------+--------------------+ | | Linux | | | | +--------------------+--------------------+ (Unix domain sockets) . socket . protocol . - mysql.sock mysqlro.sock . X Protocol - mysqlx.sock mysqlxro.sock . Windows . o --conf-use-gr-notifications +--------------------+-----------------------------+ | | --conf-use-gr-notifications | | | | +--------------------+-----------------------------+ use_gr_notifications [metadata_cache] . Router . use_gr_notifications . ttl=60 auth_cache_refresh_interval=60 . o --pid-file path +--------------------+-----------------+ | | --pid-file path | | | | +--------------------+-----------------+ | | | +--------------------+-----------------+ PID . ( ): --pid-file pid_file Router ROUTER_PID. --bootstrap --pid-file Router . ROUTER_PID pid_file --bootstrap . --bootstrap Router : --pid-file pid_file ROUTER_PID Router PID . o --report-host +--------------------+------------------------+ | | --report-host hostname | | | | +--------------------+------------------------+ | | | +--------------------+------------------------+ (hostname) Router bootstrap . Router RFC 1123 RFC 2181 . host_name mysql_innodb_cluster_metadata.hosts MySQL InnoDB . o --conf-skip-tcp +--------------------+-----------------+ | | --conf-skip-tcp | | | | +--------------------+-----------------+ | | Linux | | | | +--------------------+-----------------+ () TCP . : --conf-use-sockets. Windows . o --conf-base-port port_num +----------------------+---------------------------+ | | --conf-base-port port_num | | | | +----------------------+---------------------------+ | | | +----------------------+---------------------------+ | | 0 | | | | +----------------------+---------------------------+ ( ) TCP bind_port bootstrap. / (read-write) . : / / (read-only) x / / . --conf-base-port 0 bind_port : Read-Write 6446 Read-Only 6447 X Read-Write 64460 Read-Only 64470 . : # 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 o --conf-bind-address address +----------------------+---------------------+ | | --conf-bind-address | | | address | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | 0.0.0.0 | | | | +----------------------+---------------------+ bind_address --bootstrap Router . (bootstrapping) bind_address=0.0.0.0 . bind_address bind_address 127.0.0.1 . o --read-timeout num_seconds +----------------------+----------------------------+ | | --read-timeout num_seconds | | | | +----------------------+----------------------------+ | | | +----------------------+----------------------------+ | | 30 | | | | +----------------------+----------------------------+ (metadata server) . (bootstrap) read_timeout mysqlrouter.conf MySQL Router . [DEFAULT] . o --connect-timeout num_seconds +----------------------+------------------------+ | | --connect-timeout | | | num_seconds | +----------------------+------------------------+ | | | +----------------------+------------------------+ | | 30 | | | | +----------------------+------------------------+ (metadata server) . (bootstrap) connect_timeout mysqlrouter.conf MySQL Router . connect_timeout [DEFAULT] MySQL [routing] . o --user {user_name|user_id}, -u {user_name|user_id} +--------------------+-------------------------+ | | --user | | | {user_name|user_id}, -u | | | {user_name|user_id} | +--------------------+-------------------------+ | | Linux | | | | +--------------------+-------------------------+ | | | +--------------------+-------------------------+ mysqlrouter user_name user_id . "" MySQL (grant tables) . (bootstrapping) user . user [DEFAULT] . user --user . (uid=0) --user . --user=root. Windows . o --name router_name +----------------------+--------------------+ | | --name router_name | | | | +----------------------+--------------------+ | | | +----------------------+--------------------+ | | system | | | | +----------------------+--------------------+ (bootstrap) Router . --directory . . o --force-password-validation +--------------------+-----------------------------+ | | --force-password-validation | | | | +--------------------+-----------------------------+ | | Linux | | | | +--------------------+-----------------------------+ MySQL Router validate_password MySQL Server validate_password (STRONG) . validate_password Router . (validate_password) . o --password-retries num_retries +----------------------+------------------------+ | | --password-retries | | | num_retries | +----------------------+------------------------+ | | | +----------------------+------------------------+ | | 20 | | | | +----------------------+------------------------+ | | 1 | | | | +----------------------+------------------------+ | | 10000 | | | | +----------------------+------------------------+ MySQL Router . 20 . 1 10000 . validate_password 50 . --force-password-validation true . o --force +--------------------+---------+ | | --force | | | | +--------------------+---------+ Router . o --ssl-mode mode +----------------------+--------------------+ | | --ssl-mode mode | | | | +----------------------+--------------------+ | | | +----------------------+--------------------+ | | PREFERRED | | | | +----------------------+--------------------+ | | PREFERRED DISABLED | | | REQUIRED VERIFY_CA | | | VERIFY_IDENTITY | +----------------------+--------------------+ SSL bootstrap (metadata server). --ssl-mode mysql. bootstrap Router SSL . ssl_mode PREFERRED . Router Metadata Cache SSL . (PREFERRED) ssl_mode [metadata_cache] . DISABLED PREFERRED REQUIRED VERIFY_CA VERIFY_IDENTITY. PREFERRED . mysql . ssl_mode . o --ssl-cert file_path +----------------------+----------------------+ | | --ssl-cert file_path | | | | +----------------------+----------------------+ | | | +----------------------+----------------------+ | | | | | | +----------------------+----------------------+ SSL PEM. bootstrap . --ssl-cert MySQL . --ssl-key bootstrap root . root REQUIRE X509 root . o --ssl-key file_path +--------------------+---------------------+ | | --ssl-key file_path | | | | +--------------------+---------------------+ | | | +--------------------+---------------------+ SSL PEM. bootstrap . --ssl-key MySQL . --ssl-cert bootstrap root . root REQUIRE X509 root . o --ssl-cipher ciphers +----------------------+----------------------+ | | --ssl-cipher ciphers | | | | +----------------------+----------------------+ | | | +----------------------+----------------------+ | | | | | | +----------------------+----------------------+ SSL (":") SSL . o --tls-version versions +----------------------+------------------------+ | | --tls-version versions | | | | +----------------------+------------------------+ | | | +----------------------+------------------------+ | | | | | | +----------------------+------------------------+ TLS (",") SSL . o --ssl-ca file_path +----------------------+--------------------+ | | --ssl-ca file_path | | | | +----------------------+--------------------+ | | | +----------------------+--------------------+ | | | | | | +----------------------+--------------------+ SSL CA . o --ssl-capath dir_path +----------------------+-----------------------+ | | --ssl-capath dir_path | | | | +----------------------+-----------------------+ | | | +----------------------+-----------------------+ | | | | | | +----------------------+-----------------------+ SSL CA . o --ssl-crl file_path +----------------------+---------------------+ | | --ssl-crl file_path | | | | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | | | | | +----------------------+---------------------+ SSL CRL . o --ssl-crlpath dir_path +----------------------+------------------------+ | | --ssl-crlpath dir_path | | | | +----------------------+------------------------+ | | | +----------------------+------------------------+ | | | | | | +----------------------+------------------------+ SSL CRL . o --client-ssl-mode mode +----------------------+-------------------+ | | --client-ssl-mode | | | | +----------------------+-------------------+ | | | +----------------------+-------------------+ | | PREFERRED | | | | +----------------------+-------------------+ | | T{.PP | | | | +----------------------+-------------------+ |PREFERRED | | +----------------------+-------------------+ |DISABLED | | +----------------------+-------------------+ |PASSTHROUGH | | +----------------------+-------------------+ |REQUIRED | | +----------------------+-------------------+ |T} | | +----------------------+-------------------+ SSL (bootstrap) MySQL Router . Router SSL . client_ssl_mode PREFERRED . client_ssl_mode . o --client-ssl-cert file_path +----------------------+-------------------+ | | --client-ssl-cert | | | file_path | +----------------------+-------------------+ | | String | +----------------------+-------------------+ | | | | | | +----------------------+-------------------+ SSL PEM. (bootstrap) . --client-ssl-key root . root REQUIRE X509 root . o client-ssl-curves +--------------------+---------------------+ | | --client-ssl-curves | | | | +--------------------+---------------------+ | | String | +--------------------+---------------------+ SSL . (:) . o --client-ssl-key file_path +--------------------+----------------------------+ | | --client-ssl-key file_path | | | | +--------------------+----------------------------+ | | String | +--------------------+----------------------------+ SSL PEM. (bootstrap) . --client-ssl-cert root . root REQUIRE X509 root . o --client-ssl-cipher ciphers +--------------------+---------------------+ | | --client-ssl-cipher | | | | +--------------------+---------------------+ | | String | +--------------------+---------------------+ SSL (":") SSL . o client-ssl-dh-params +--------------------+---------------------------------+ | | --client-ssl-dh-params=filepath | | | | +--------------------+---------------------------------+ | | String | +--------------------+---------------------------------+ DH. DH DH . DH PEM . o --client-ssl-ca file_path +----------------------+---------------------------+ | | --client-ssl-ca file_path | | | | +----------------------+---------------------------+ | | String | +----------------------+---------------------------+ | | | | | | +----------------------+---------------------------+ CA SSL . o --client-ssl-capath dir_path +----------------------+---------------------+ | | --client-ssl-capath | | | dir_path | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | | | | | +----------------------+---------------------+ CA SSL . o --client-ssl-crl file_path +----------------------+----------------------------+ | | --client-ssl-crl file_path | | | | +----------------------+----------------------------+ | | | +----------------------+----------------------------+ | | | | | | +----------------------+----------------------------+ CRL SSL . o --client-ssl-crlpath dir_path +----------------------+----------------------+ | | --client-ssl-crlpath | | | dir_path | +----------------------+----------------------+ | | | +----------------------+----------------------+ | | | | | | +----------------------+----------------------+ CRL SSL . o --server-ssl-mode mode +----------------------+--------------------+ | | --server-ssl-mode | | | | +----------------------+--------------------+ | | | +----------------------+--------------------+ | | PREFERRED | | | | +----------------------+--------------------+ | | AS_CLIENT DISABLED | | | PREFERRED REQUIRED | +----------------------+--------------------+ SSL (bootstrap) MySQL Router . Router SSL . server_ssl_mode PREFERRED . server_ssl_mode . o --server-ssl-cipher ciphers +--------------------+---------------------+ | | --server-ssl-cipher | | | | +--------------------+---------------------+ | | | +--------------------+---------------------+ SSL (":") SSL. o --server-ssl-ca file_path +----------------------+---------------------------+ | | --server-ssl-ca file_path | | | | +----------------------+---------------------------+ | | | +----------------------+---------------------------+ | | | | | | +----------------------+---------------------------+ CA SSL . o --server-ssl-capath dir_path +----------------------+---------------------+ | | --server-ssl-capath | | | dir_path | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | | | | | +----------------------+---------------------+ CA SSL . o --server-ssl-crl file_path +----------------------+----------------------------+ | | --server-ssl-crl file_path | | | | +----------------------+----------------------------+ | | | +----------------------+----------------------------+ | | | | | | +----------------------+----------------------------+ CRL SSL . o --server-ssl-crlpath dir_path +----------------------+----------------------+ | | --server-ssl-crlpath | | | dir_path | +----------------------+----------------------+ | | | +----------------------+----------------------+ | | | | | | +----------------------+----------------------+ CRL SSL . o server-ssl-curves +--------------------+---------------------+ | | --server-ssl-curves | | | | +--------------------+---------------------+ | | | +--------------------+---------------------+ SSL . (:) . o --server-ssl-verify string +----------------------+---------------------+ | | --server-ssl-verify | | | | +----------------------+---------------------+ | | | +----------------------+---------------------+ | | DISABLED | | | | +----------------------+---------------------+ | | DISABLED VERIFY_CA | | | VERIFY_IDENTITY | +----------------------+---------------------+ SSL o DISABLED: (handshake) . o VERIFY_CA: CA MySQL Router . o VERIFY_IDENTITY: CA MySQL Router (subject) IP MySQL Router . o --config file_path, -c file_path +--------------------+------------------------+ | | --config file_path, -c | | | file_path | +--------------------+------------------------+ . . --bootstrap .bak . .bak . o --extra-config file_path, -a file_path +--------------------+---------------------------+ | | --extra-config file_path, | | | -a file_path | +--------------------+---------------------------+ . . . ( ) . o --install-service +--------------------+-------------------+ | | --install-service | | | [service_name] | +--------------------+-------------------+ | | Windows | | | | +--------------------+-------------------+ Router Windows Windows . MySQLRouter . --config . Windows . o --install-service-manual +--------------------+--------------------------+ | | --install-service-manual | | | [service_name] | +--------------------+--------------------------+ | | Windows | | | | +--------------------+--------------------------+ MySQL Router Windows . MySQLRouter . Windows . o --remove-service +--------------------+------------------+ | | --remove-service | | | [service_name] | +--------------------+------------------+ | | Windows | | | | +--------------------+------------------+ Windows Router MySQLRouter . Windows . o --service +--------------------+-----------+ | | --service | | | | +--------------------+-----------+ | | Windows | | | | +--------------------+-----------+ Router Windows. Windows Service Router . Windows . o --update-credentials-section +--------------------+------------------------------+ | | --update-credentials-section | | | section_name | +--------------------+------------------------------+ | | Windows | | | | +--------------------+------------------------------+ Windows (password vault) . o --conf-target-cluster +--------------------+-----------------------+ | | --conf-target-cluster | | | value | +--------------------+-----------------------+ | | | +--------------------+-----------------------+ | | current primary | | | | +--------------------+-----------------------+ target_cluster MySQL Router . : o current: target_cluster (bootstrap) . UUID . (Primary) primary . o primary: target_cluster (primary) . --config-target-cluster-by-name target_cluster . ClusterSet[2] cluster_type Router gr . o --conf-set-option +--------------------+--------------------------------------------------+ | | --conf-set-option | | | section_name[:optional_section_key].option=value | +--------------------+--------------------------------------------------+ | | | +--------------------+--------------------------------------------------+ : $> 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 : [logger] level=debug [routing:test_rw] ... max_connect_errors=0 ... [routing:test_ro] ... max_connect_errors=0 ... --conf-set-option . --connect-timeout=X --conf-set-option=DEFAULT.connect_timeout=Y connect_timeout Y . o --conf-target-cluster-by-name +--------------------+-------------------------------+ | | --conf-target-cluster-by-name | | | clusterName | +--------------------+-------------------------------+ | | | +--------------------+-------------------------------+ target_cluster MySQL Router . --conf-target-cluster primary . o --remove-credentials-section section_name +-------------------------------+------------------------------+ | | --remove-credentials-section | | | section_name | +-------------------------------+------------------------------+ | | Windows | | | | +-------------------------------+------------------------------+ . Windows (password vault) . o --clear-all-credentials +-------------------------------+-------------------------+ | | --clear-all-credentials | | | | +-------------------------------+-------------------------+ | | Windows | | | | +-------------------------------+-------------------------+ . Windows (password vault) . o --disable-rest +--------------------+----------------+ | | --disable-rest | | | | +--------------------+----------------+ MySQL Router REST API bootstrap mysqlrouter.conf . REST API REST API ( ) . o --https-port +----------------------+------------------------+ | | --https-port value | | | | +----------------------+------------------------+ | | | +----------------------+------------------------+ | | 8443 | | | | +----------------------+------------------------+ | | 1 | | | | +----------------------+------------------------+ | | 65535 | | | | +----------------------+------------------------+ port HTTP MySQL Router REST API [http_server] mysqlrouter.conf bootstrap . 8443 . . (C) 2006, 2026 Oracle / . << >> (GNU General Public License) << >> (Free Software Foundation) / . << >> << >> << >>. << >> . << >> Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA http://www.gnu.org/licenses . (NOTES) 1. URI https://dev.mysql.com/doc/refman/9.7/en/connecting-using-uri-or- key-value-pairs.html#connecting-using-uri 2. ClusterSet https://dev.mysql.com/doc/mysql-shell/9.7/en/innodb-clusterset.html (AUTHORS) Oracle Corporation (http://dev.mysql.com). MySQL 9.7 03/24/2026 MYSQLROUTER(1)