MySQL Router 8.4  /  ...  /  Defining Options Using the Command Line

4.3.1 Defining Options Using the Command Line

Options can be configured and overridden at runtime using these different methods:

  • Using standard runtime options as shown by mysqlrouter --help; how it affects the generated configuration file depends on the option. For example:

    $> mysqlrouter --bootstrap foo@bar.com --connect-timeout=20
  • Using the form --section[:section_key].option_name=option_value at runtime; this does not affect the generated configuration file. This is typically used for testing as using a configuration file is preferred. For example:

    $> mysqlrouter -c mysqrouter.conf --logger.level=debug
  • Using the --conf-set-option=section[:section_key].option_name=option_value option that does alter the generated configuration file. This is used while bootstrapping to add or override a configuration option. It has precedence over other forms.

    $> mysqlrouter --bootstrap foo@bar.com \
      --conf-set-option=logger.level=debug \
      --conf-set-option=DEFAULT.unknown_config_option=warning \
      --conf-set-option=DEFAULT.connect_timeout=20 \
      --connect-timeout=10

    This sets connect_timeout to 20 in the generated mysqlrouter.conf because --conf-set-option always takes precedence.