Documentation Home
MySQL 9.2 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.5Mb
PDF (A4) - 40.6Mb
Man Pages (TGZ) - 259.6Kb
Man Pages (Zip) - 366.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


2.3.2.2 MySQL Configurator CLI

MySQL Configurator supports GUI (default) and CLI (by passing in --console) modes using the mysql_configurator.exe executable.

Important

Known Limitation: only the configure action is supported in MySQL Configurator 9.2.0.

Note

MySQL Configurator CLI functionality was added in MySQL Configurator 9.2.0.

Executing MySQL Configurator requires a Windows user with administrative privileges, as otherwise the system prompts for the credentials.

CLI Syntax

The general syntax is:

Press CTRL+C to copy
mysql_configurator.exe --console [--help] | [--action=action_name | -a=action_name] | ...]

Table 2.6 Syntax

Option name Shortcut Supported values Usage example Description
console c N/A --console Activates the CLI in MySQL Configurator, otherwise the GUI is launched.
action a configure, reconfigure, remove, or upgrade --action=configure Runs MySQL Configurator CLI in new configuration, reconfiguration, removal or upgrade mode.
help h N/A --help Displays general help or help for the corresponding action. If no --action element is provided, the general help section is displayed.
action option and value N/A See section "Configure/Reconfigure/Remove/Upgrade options" for supported values and details --datadir="C:\MySQL...", --port=3306 Defines the various configuration options available for each CLI action (configuration, reconfiguration, removal or upgrade)

Available Actions

Each action (configure, reconfigure, remove, and upgrade) have a specific set of options that define the elements to configure when performing the operation. The syntax is --action_option=action_value with a full list of action options below:

Table 2.7 Action Options

Action option Shortcut Aliases Type Values Default value Action Condition Description
datadir d data-dir, data-directory Path N/A "C:\ProgramData\MySQL\MySQL Server x.x" where x.x corresponds to the corresponding server major and minor version. configure N/A The path to the MySQL server data directory. This option sets the datadir system variable.
config-type N/A configuration-type list Developer, Server, Dedicated, Manual development configure, reconfigure N/A Optimizes system resources depending on the intended use of the server instance.
enable-tcp-ip N/A N/A bool true, false true configure, reconfigure N/A Indicates whether the server permits connections over TCP/IP.
port P N/A number N/A 3306 configure, reconfigure enable-tcp-id=true The port number to use when listening for TCP/IP connections.
mysqlx-port X x-port, xport number N/A 3306 configure, reconfigure enable-tcp-ip=true The network port on which X Plugin listens for TCP/IP connections. This is the X Plugin equivalent of port.
open_win_firewall N/A open-windows-firewall, openfirewall bool true, false true configure, reconfigure enable-tcp-ip=true Creates Windows Firewall rules for TCP/IP connections for both the port and mysqlx-port options.
enable-named-pipes N/A named-pipes bool true, false false configure, reconfigure N/A Indicates whether the server permits connections over a named pipe.
socket N/A pipe-name, named-pipe-name, named-pipe, pipename string N/A MYSQL configure, reconfigure enable-named-pipes=true Specifies the pipe name to use when listening for local connections that use a named pipe. The default value is MySQL, and it is not case-sensitive.
named-pipe-full-access-group N/A full-access-group string "", everyone, valid Windows local group name "" (empty string) configure, reconfigure enable-named-pipes=true Sets the name of a Windows local group whose members are granted sufficient access by the MySQL server to use named-pipe clients. The default value is an empty string, which means that no Windows users are granted full access to the named pipe.
shared-memory N/A enable-shared-memory bool true, false false configure, reconfigure N/A Whether the server permits shared-memory connections.
shared-memory-base-name N/A shared-memory-name, shared-mem-name string N/A MYSQL configure, reconfigure shared-memory=true Name of the shared-memory connection used to communicate with the server.
password p pwd, root-password, passwd, rootpasswd string N/A N/A configure, reconfigure N/A The password assigned to the root user during a configuration or reconfiguration. The password can't be changed during a reconfiguration, although it is required to validate a connection to the server.
configure-as-service N/A as-windows-service, as-win-service bool true, false true configure, reconfigure N/A Configures the MySQL server to run as a Windows service. By default the Windows service runs using the Standard System Account (Network Service).
windows-service-name N/A service-name, win-service-name, servicename string N/A "MySQLxx" where xx corresponds to the server major and minor version. configure, reconfigure configure-as-service=true The name given to the Windows service used to run MySQL Server.
windows-service-auto-start N/A win-service-auto-start, service-auto-start, auto-start, autostart bool true, false true configure, reconfigure configure-as-service=true If configured as a Windows Service, this value sets the service to start automatically at system startup.
windows-service-user N/A win-service-user, service-user string N/A NT AUTHORITY configure, reconfigure configure-as-service=true The name of a Windows User Account used to run the Windows service.
windows-service-password N/A win-service-password, win-service-pwd, service-password, service-pwd, sapass string N/A "" (empty string) configure, reconfigure configure-as-service=true The password of the Windows User Account used to run the Windows Service.
server-file-permissions-access N/A server-file-access list FullAccess, Configure, Manual full-access configure, upgrade N/A Configures the user level access for the server files (data directory and any files inside that location).
server-file-full-control-list N/A full-control-list comma separated list windows users/groups user running the windows service (if applicable) and Administrators group configure, upgrade server-file-permissions-access=configure Defines a comma-separated list of users or groups to have full access to the server files.
server-file-no-access-list N/A no-access-list comma separated list windows users/groups empty configure, upgrade server-file-permissions-access=configure Defines a comma-separated list of users or groups to have access to the server files.
enable-error-log N/A enable-err-log bool true, false true configure, reconfigure N/A Enables the error log. The error log contains a record of mysqld startup and shutdown times. It also contains diagnostic messages such as errors, warnings, and notes that occur during server startup and shutdown; and while the server is running.
log-error N/A error-log, error-log-file, errorlogname Path/File name N/A {host_name}.err configure, reconfigure enable-error-log=true Defines the error log location. If a path is not provided, the location of the file is the data directory.
slow-query-log N/A enable-slow-log bool true, false false configure, reconfigure N/A Whether the slow query log is enabled.
slow-query-log-file N/A slow-log-file, slowlogname File name N/A {host_name}-slow.log configure, reconfigure slow-query-log=true The name of the slow query log file.
general-log N/A enable-general-log, generallog bool true, false false configure, reconfigure N/A Whether the general query log is enabled.
general-log-file N/A generallogname File name N/A {host_name}.log configure, reconfigure general-log=true The name of the general query log file.
enable-log-bin N/A enable-binary-log bool true, false true configure, reconfigure N/A Enables binary logging.
log-bin N/A binary-log File name N/A {host_name}-bin configure, reconfigure enable-log-bin=true Specifies the base name to use for binary log files. With binary logging enabled, the server logs all statements that change data to the binary log, which is used for backup and replication. The binary log is a sequence of files with a base name and numeric extension.
server-id N/A serverid number N/A 1 configure N/A For servers that are used in a replication topology, you must specify a unique server ID for each replication server in the range from 1 to 2^32 - 1. "Unique" means that each ID must be different from every other ID in use by any other source or replica servers in the replication topology.
lower-case-table-names N/A N/A list 0, 1, 2 1 configure N/A If set to 0, table names are stored as specified and comparisons are case-sensitive. If set to 1, table names are stored in lowercase on disk and comparisons are not case-sensitive. If set to 2, table names are stored as given but compared in lowercase. This option also applies to database names and table aliases.
install-sample-database N/A install-example-database list All, Sakila, World, None none configure, reconfigure N/A Installs the specified sample databases.
uninstall-sample-database N/A uninstall-example-database list All, Sakila, World, None none configure, reconfigure N/A Uninstalls the specified sample databases.
old-instance-protocol N/A existing-instance-protocol list Socket, Sockets, Tcp, Pipe, NamedPipe, SharedMemory, Memory N/A tcp-ip upgrade The connection protocol used by the server instance that is being upgraded.
old-instance-port N/A existing-instance-port number N/A 3306 upgrade N/A The port number to use by the server instance that is being upgraded when listening for TCP/IP connections
old-instance-pipe-name N/A existing-instance-pipe-name string N/A MYSQL upgrade N/A Specifies the pipe name to use by the server instance that is being upgraded when listening for local connections that use a named pipe.
old-instance-memory-name N/A old-instance-shared-memory-name, existing-instance-memory-name, existing-instance-shared-memory-name string N/A MYSQL upgrade N/A The name of the shared-memory connection used by the server instance that is being upgraded to communicate with the server.
old-instance-password N/A old-instance-pwd, old-instance-root-password, existing-instance-password, existing-instance-pwd, existing-instance-pwd string N/A N/A upgrade N/A The password of the root user used by the server instance that is being upgraded.
backup-data N/A backup-data-directory bool true, false true upgrade N/A Creates a backup of the databases to ensure data can be restored in case of any failure.
keep-data-directory N/A keep-data bool true, false false remove N/A Prevents the data directory from being deleted when other configurations are removed.
defaults-extra-file N/A password-file, pass-file, pwd-file Path N/A N/A reconfigure, upgrade N/A The path and file name of the file containing the password entry that specifies the password of the root user.
windows-service-account-password-file N/A windows-service-account-password-file, win-service-account-pass-file, service-account-pwd-file, win-service-account-pwd-file, service-account-password-file Path N/A N/A configure, reconfigure N/A The path and file name of the file containing the password entry that specifies the password of the Windows service account user associated with the Windows Service that runs the server.
Action option Shortcut Aliases Type Values Default value Action Condition Description

MySQL User Management

The configure and reconfigure actions allow you to create and edit MySQL users as per the --add-user option:

  • --add-user='user_name':'password'|'file_path'|'windows_security_token':host:role:authentication

    Only valid for the configure (not reconfigure) action.

The username, password, and token file path must be enclosed in single or double quotes. Escape single quotes, double quotes, and back slashes if present in the username or password.

Add user examples:

Press CTRL+C to copy
mysql_configurator.exe --console --action=configure --add-user='john':'mypass12%':%:"Db Admin":MYSQL mysql_configurator.exe --console --action=configure --add-user='jenny':'jenny-T480\jenny':localhost:"Administrator":Windows
General Examples

A new configuration:

Press CTRL+C to copy
# Simple mysql_configurator.exe --console --action=configure --password=test # More complex mysql_configurator.exe --console --action=configure --password=test --port=3320 --enable-pipe-names --pipe-name=MYSQL_PIPE --server-id=2 --install-sample-database=both # More complex, also with users mysql_configurator.exe --console --action=configure --password=other123 --add-user='john':'pa$$':"Db Admin":MYSQL --add-user='mary':'p4ssW0rd':"Administrator":MYSQL

A reconfiguration:

Press CTRL+C to copy
# Basic reconfiguration mysql_configurator.exe --console --action=reconfigure --password=test --port=3310 # Complex reconfiguration mysql_configurator.exe --console --action=reconfigure --password=test --enable-shared-memory=false

A removal:

Press CTRL+C to copy
mysql_configurator.exe --console --action=remove --keep-data-directory=true

An upgrade:

Press CTRL+C to copy
# Basic removal mysql_configurator.exe --console --action=upgrade --old-instance-password=test # Complex removal mysql_configurator.exe --console --action=upgrade --old-instance-password=test --backup-data=false --server-file-permissions-access=full
Root Password Handling

There are multiple ways to pass in the root user password, depending on the needs in terms of security and simplicity. The different methods, in order of precedence:

  1. Pass passwords as command-line arguments:

    Pass in the --password (for configuration and reconfiguration) or --old-instance-password (for upgrades) to the command line.

  2. Set passwords in the my.ini MySQL configuration file:

    Having the entry "password={password_here}" directly in the my.ini defines the root user password.

    Having the entry "password={password_here}" in the extra configuration file (as per --defaults-extra-file) can define the root user password.

  3. Defining passwords using environment variables:

    MYSQL_PWD: Similar to the MySQL client, the value defined in the MYSQL_PWD environment variable can define the root user password if no other method was used to define it. This variable applies to the configure, reconfigure, and upgrade actions.

    WIN_SERVICE_ACCOUNT_PWD: This environment variable can set the password of the Windows service account user that is configured to run the MySQL Windows Service if the server has been configured to run as a service. This variable applies to the configure and reconfigure actions.