OS Manuals

/usr/bin/mysqlctld

Autoscaling components for Kubernetes

From vitess-24 24.0.5-r11 (enterprise-packages), captured 2026-11-08 by running mysqlctld --help (exit 0). permalink

`mysqlctld` is a gRPC server that can be used instead of the `mysqlctl` client tool.
If the target directories are empty when it is invoked, it automatically performs initialization operations to bootstrap the `mysqld` instance before starting it.
The `mysqlctld` process can subsequently receive gRPC commands from a `vttablet` to perform housekeeping operations like shutting down and restarting the `mysqld` instance as needed.

{{< warning >}}
`mysqld_safe` is not used so the `mysqld` process will not be automatically restarted in case of a failure.
{{</ warning>}}

To enable communication with a `vttablet`, the server must be configured to receive gRPC messages on a unix domain socket.

Usage:
  mysqlctld [flags]

Examples:
mysqlctld \
	--log_dir=${VTDATAROOT}/logs \
	--tablet-uid=100 \
	--mysql-port=17100 \
	--socket-file=/path/to/socket-file

Flags:
      --app-idle-timeout duration                                        Idle timeout for app connections (default 1m0s)
      --app-pool-size int                                                Size of the connection pool for app connections (default 40)
      --bind-address string                                              Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system.
      --catch-sigpipe                                                    catch and ignore SIGPIPE on stdout and stderr if specified
      --config-file string                                               Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
      --config-file-not-found-handling ConfigFileNotFoundHandling        Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
      --config-name string                                               Name of the config file (without extension) to search for. (default "vtconfig")
      --config-path strings                                              Paths to search for config files in. (default [/tmp])
      --config-persistence-min-interval duration                         minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s)
      --config-type string                                               Config file type (omit to infer config type from file extension).
      --db-charset string                                                Character set/collation used for this tablet. Make sure to configure this to a charset/collation supported by the lowest MySQL version in your environment. (default "utf8mb4")
      --db-conn-query-info                                               enable parsing and processing of QUERY_OK info fields
      --db-connect-timeout-ms int                                        connection timeout to mysqld in milliseconds (0 for no timeout)
      --db-credentials-file string                                       db credentials file; send SIGHUP to reload this file
      --db-credentials-server string                                     db credentials server type ('file' - file implementation; 'vault' - HashiCorp Vault implementation) (default "file")
      --db-credentials-vault-addr string                                 URL to Vault server
      --db-credentials-vault-path string                                 Vault path to credentials JSON blob, e.g.: secret/data/prod/dbcreds
      --db-credentials-vault-role-mountpoint string                      Vault AppRole mountpoint; can also be passed using VAULT_MOUNTPOINT environment variable (default "approle")
      --db-credentials-vault-role-secretidfile string                    Path to file containing Vault AppRole secret_id; can also be passed using VAULT_SECRETID environment variable
      --db-credentials-vault-roleid string                               Vault AppRole id; can also be passed using VAULT_ROLEID environment variable
      --db-credentials-vault-timeout duration                            Timeout for vault API operations (default 10s)
      --db-credentials-vault-tls-ca string                               Path to CA PEM for validating Vault server certificate
      --db-credentials-vault-tokenfile string                            Path to file containing Vault auth token; token can also be passed using VAULT_TOKEN environment variable
      --db-credentials-vault-ttl duration                                How long to cache DB credentials from the Vault server (default 30m0s)
      --db-dba-password string                                           db dba password
      --db-dba-use-ssl                                                   Set this flag to false to make the dba connection to not use ssl (default true)
      --db-dba-user string                                               db dba user userKey (default "vt_dba")
      --db-flags uint                                                    Flag values as defined by MySQL.
      --db-flavor string                                                 Flavor overrid. Valid value is FilePos.
      --db-host string                                                   The host name for the tcp connection.
      --db-port int                                                      tcp port
      --db-server-name string                                            server name of the DB we are connecting to.
      --db-socket string                                                 The unix socket to connect on. If this is specified, host and port will not be used.
      --db-ssl-ca string                                                 connection ssl ca
      --db-ssl-ca-path string                                            connection ssl ca path
      --db-ssl-cert string                                               connection ssl certificate
      --db-ssl-key string                                                connection ssl key
      --db-ssl-mode SslMode                                              SSL mode to connect with. One of disabled, preferred, required, verify_ca & verify_identity.
      --db-tls-min-version string                                        Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3.
      --dba-idle-timeout duration                                        Idle timeout for dba connections (default 1m0s)
      --dba-pool-size int                                                Size of the connection pool for dba connections (default 20)
      --grpc-auth-mode string                                            Which auth plugin implementation to use (eg: static)
      --grpc-auth-mtls-allowed-substrings string                         List of substrings of at least one of the client certificate names (separated by colon).
      --grpc-auth-static-client-creds string                             When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.
      --grpc-auth-static-password-file string                            JSON File to read the users/passwords from.
      --grpc-bind-address string                                         Bind address for gRPC calls. If empty, listen on all addresses.
      --grpc-ca string                                                   server CA to use for gRPC connections, requires TLS, and enforces client certificate check
      --grpc-cert string                                                 server certificate to use for gRPC connections, requires grpc-key, enables TLS
      --grpc-compression string                                          Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy
      --grpc-crl string                                                  path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake
      --grpc-dial-concurrency-limit int                                  Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000. (default 1024)
      --grpc-enable-optional-tls                                         enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port; plain-text connections are served unauthenticated, even with --grpc-ca
      --grpc-enable-orca-metrics                                         gRPC server option to enable sending ORCA metrics to clients for load balancing
      --grpc-initial-conn-window-size int                                gRPC initial connection window size
      --grpc-initial-window-size int                                     gRPC initial window size
      --grpc-keepalive-time duration                                     After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
      --grpc-keepalive-timeout duration                                  After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
      --grpc-key string                                                  server private key to use for gRPC connections, requires grpc-cert, enables TLS
      --grpc-max-connection-age duration                                 Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
      --grpc-max-connection-age-grace duration                           Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
      --grpc-port int                                                    Port to listen on for gRPC calls. If zero, do not listen.
      --grpc-server-ca string                                            path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients
      --grpc-server-initial-conn-window-size int                         gRPC server initial connection window size
      --grpc-server-initial-window-size int                              gRPC server initial window size
      --grpc-server-keepalive-enforcement-policy-min-time duration       gRPC server minimum keepalive time (default 10s)
      --grpc-server-keepalive-enforcement-policy-permit-without-stream   gRPC server permit client keepalive pings even when there are no active streams (RPCs)
      --grpc-server-keepalive-time duration                              After a duration of this time, if the server doesn't see any activity, it pings the client to see if the transport is still alive. (default 10s)
      --grpc-server-keepalive-timeout duration                           After having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
  -h, --help                                                             help for mysqlctld
      --init-db-sql-file string                                          Path to .sql file to run after mysqld initialization
      --keep-logs duration                                               keep logs for this long (using ctime) (zero to keep forever)
      --keep-logs-by-mtime duration                                      keep logs for this long (using mtime) (zero to keep forever)
      --lameduck-period duration                                         keep running at least this long after SIGTERM before stopping (default 50ms)
      --log-err-stacks                                                   log stack traces for errors
      --log-format string                                                log output format: json for machine-readable JSON, text for human-readable colored output (default "json")
      --log-level string                                                 minimum log level when structured logging is enabled (debug, info, warn, error) (default "info")
      --log-rotate-max-size uint                                         size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
      --log-structured                                                   enable structured JSON logging (default true)
      --max-stack-size int                                               configure the maximum stack size in bytes (default 67108864)
      --mysql-port int                                                   MySQL port (default 3306)
      --mysql-server-version string                                      MySQL server version to advertise. (default "8.4.6-Vitess")
      --mysql-socket string                                              Path to the mysqld socket file
      --mysqlctl-mycnf-template string                                   template file to use for generating the my.cnf file during server init
      --mysqlctl-socket string                                           socket file to use for remote mysqlctl actions (empty for local actions)
      --onclose-timeout duration                                         wait no more than this for OnClose handlers before stopping (default 10s)
      --onterm-timeout duration                                          wait no more than this for OnTermSync handlers before stopping (default 5m10s)
      --pid-file string                                                  If set, the process will write its pid to the named file, and delete it on graceful shutdown.
      --pool-hostname-resolve-interval duration                          if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
      --port int                                                         port for the server
      --pprof strings                                                    enable profiling
      --pprof-http                                                       enable pprof http endpoints
      --purge-logs-interval duration                                     how often try to remove old logs (default 1h0m0s)
      --replication-connect-retry duration                               how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
      --security-policy string                                           the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
      --service-map strings                                              comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice
      --shutdown-wait-time duration                                      How long to wait for mysqld shutdown (default 5m0s)
      --socket-file string                                               Local unix socket file to listen on
      --table-refresh-interval int                                       interval in milliseconds to refresh tables in status page with refreshRequired class
      --tablet-dir string                                                The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
      --tablet-uid uint32                                                Tablet UID (default 41983)
  -v, --version                                                          print binary version
      --wait-time duration                                               How long to wait for mysqld startup (default 5m0s)
Options (103)
OptionDescriptionSource
--log_dir ${VTDATAROOT}/logshelp
--tablet-uid 100help
--mysql-port 17100help
--socket-file /path/to/socket-filehelp
--app-idle-timeout durationIdle timeout for app connections (default 1m0s)help
--app-pool-size intSize of the connection pool for app connections (default 40)help
--bind-address stringBind address for the server.help
--catch-sigpipecatch and ignore SIGPIPE on stdout and stderr if specifiedhelp
--config-file stringFull path of the config file (with extension) to use.help
--config-file-not-found-handling ConfigFileNotFoundHandlingBehavior when a config file is not found.help
--config-name stringName of the config file (without extension) to search for.help
--config-path stringsPaths to search for config files in.help
--config-persistence-min-interval durationminimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done).help
--config-type stringConfig file type (omit to infer config type from file extension).help
--db-charset stringCharacter set/collation used for this tablet.help
--db-conn-query-infoenable parsing and processing of QUERY_OK info fieldshelp
--db-connect-timeout-ms intconnection timeout to mysqld in milliseconds (0 for no timeout)help
--db-credentials-file stringdb credentials file;help
--db-credentials-server stringdb credentials server type ('file' - file implementation;help
--db-credentials-vault-addr stringURL to Vault serverhelp
--db-credentials-vault-path stringVault path to credentials JSON blob, e.g.: secret/data/prod/dbcredshelp
--db-credentials-vault-role-mountpoint stringVault AppRole mountpoint;help
--db-credentials-vault-role-secretidfile stringPath to file containing Vault AppRole secret_id;help
--db-credentials-vault-roleid stringVault AppRole id;help
--db-credentials-vault-timeout durationTimeout for vault API operations (default 10s)help
--db-credentials-vault-tls-ca stringPath to CA PEM for validating Vault server certificatehelp
--db-credentials-vault-tokenfile stringPath to file containing Vault auth token;help
--db-credentials-vault-ttl durationHow long to cache DB credentials from the Vault server (default 30m0s)help
--db-dba-password stringdb dba passwordhelp
--db-dba-use-sslSet this flag to false to make the dba connection to not use ssl (default true)help
--db-dba-user stringdb dba user userKey (default "vt_dba")help
--db-flags uintFlag values as defined by MySQL.help
--db-flavor stringFlavor overrid.help
--db-host stringThe host name for the tcp connection.help
--db-port inttcp porthelp
--db-server-name stringserver name of the DB we are connecting to.help
--db-socket stringThe unix socket to connect on.help
--db-ssl-ca stringconnection ssl cahelp
--db-ssl-ca-path stringconnection ssl ca pathhelp
--db-ssl-cert stringconnection ssl certificatehelp
--db-ssl-key stringconnection ssl keyhelp
--db-ssl-mode SslModeSSL mode to connect with.help
--db-tls-min-version stringConfigures the minimal TLS version negotiated when SSL is enabled.help
--dba-idle-timeout durationIdle timeout for dba connections (default 1m0s)help
--dba-pool-size intSize of the connection pool for dba connections (default 20)help
--grpc-auth-mode stringWhich auth plugin implementation to use (eg: static)help
--grpc-auth-mtls-allowed-substrings stringList of substrings of at least one of the client certificate names (separated by colon).help
--grpc-auth-static-client-creds stringWhen using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.help
--grpc-auth-static-password-file stringJSON File to read the users/passwords from.help
--grpc-bind-address stringBind address for gRPC calls.help
--grpc-ca stringserver CA to use for gRPC connections, requires TLS, and enforces client certificate checkhelp
--grpc-cert stringserver certificate to use for gRPC connections, requires grpc-key, enables TLShelp
--grpc-compression stringWhich protocol to use for compressing gRPC.help
--grpc-crl stringpath to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshakehelp
--grpc-dial-concurrency-limit intMaximum concurrency of grpc dial operations.help
--grpc-enable-optional-tlsenable optional TLS mode when a server accepts both TLS and plain-text connections on the same port;help
--grpc-enable-orca-metricsgRPC server option to enable sending ORCA metrics to clients for load balancinghelp
--grpc-initial-conn-window-size intgRPC initial connection window sizehelp
--grpc-initial-window-size intgRPC initial window sizehelp
--grpc-keepalive-time durationAfter a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive.help
--grpc-keepalive-timeout durationAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.help
--grpc-key stringserver private key to use for gRPC connections, requires grpc-cert, enables TLShelp
--grpc-max-connection-age durationMaximum age of a client connection before GoAway is sent.help
--grpc-max-connection-age-grace durationAdditional grace period after grpc-max-connection-age, after which connections are forcibly closed.help
--grpc-port intPort to listen on for gRPC calls.help
--grpc-server-ca stringpath to server CA in PEM format, which will be combine with server cert, return full certificate chain to clientshelp
--grpc-server-initial-conn-window-size intgRPC server initial connection window sizehelp
--grpc-server-initial-window-size intgRPC server initial window sizehelp
--grpc-server-keepalive-enforcement-policy-min-time durationgRPC server minimum keepalive time (default 10s)help
--grpc-server-keepalive-enforcement-policy-permit-without-streamgRPC server permit client keepalive pings even when there are no active streams (RPCs)help
--grpc-server-keepalive-time durationAfter a duration of this time, if the server doesn't see any activity, it pings the client to see if the transport is still alive.help
--grpc-server-keepalive-timeout durationAfter having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that the connection is closed.help
-h, --helphelp for mysqlctldhelp
--init-db-sql-file stringPath to .sql file to run after mysqld initializationhelp
--keep-logs durationkeep logs for this long (using ctime) (zero to keep forever)help
--keep-logs-by-mtime durationkeep logs for this long (using mtime) (zero to keep forever)help
--lameduck-period durationkeep running at least this long after SIGTERM before stopping (default 50ms)help
--log-err-stackslog stack traces for errorshelp
--log-format stringlog output format: json for machine-readable JSON, text for human-readable colored output (default "json")help
--log-level stringminimum log level when structured logging is enabled (debug, info, warn, error) (default "info")help
--log-rotate-max-size uintsize in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)help
--log-structuredenable structured JSON logging (default true)help
--max-stack-size intconfigure the maximum stack size in bytes (default 67108864)help
--mysql-server-version stringMySQL server version to advertise.help
--mysql-socket stringPath to the mysqld socket filehelp
--mysqlctl-mycnf-template stringtemplate file to use for generating the my.cnf file during server inithelp
--mysqlctl-socket stringsocket file to use for remote mysqlctl actions (empty for local actions)help
--onclose-timeout durationwait no more than this for OnClose handlers before stopping (default 10s)help
--onterm-timeout durationwait no more than this for OnTermSync handlers before stopping (default 5m10s)help
--pid-file stringIf set, the process will write its pid to the named file, and delete it on graceful shutdown.help
--pool-hostname-resolve-interval durationif set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)help
--port intport for the serverhelp
--pprof stringsenable profilinghelp
--pprof-httpenable pprof http endpointshelp
--purge-logs-interval durationhow often try to remove old logs (default 1h0m0s)help
--replication-connect-retry durationhow long to wait in between replica reconnect attempts.help
--security-policy stringthe name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)help
--service-map stringscomma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservicehelp
--shutdown-wait-time durationHow long to wait for mysqld shutdown (default 5m0s)help
--table-refresh-interval intinterval in milliseconds to refresh tables in status page with refreshRequired classhelp
--tablet-dir stringThe directory within the vtdataroot to store vttablet/mysql files.help
-v, --versionprint binary versionhelp
--wait-time durationHow long to wait for mysqld startup (default 5m0s)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.