When you start the mysqld server, you can specify program options using any of the methods described in Section 6.2.2, “Specifying Program Options”. The most common methods are to provide options in an option file or on the command line. However, in most cases it is desirable to make sure that the server uses the same options each time it runs. The best way to ensure this is to list them in an option file. See Section 6.2.2.2, “Using Option Files”. That section also describes option file format and syntax.
mysqld reads options from the
[mysqld] and [server]
groups. mysqld_safe reads options from the
[mysqld], [server],
[mysqld_safe], and
[safe_mysqld] groups.
mysql.server reads options from the
[mysqld] and [mysql.server]
groups.
mysqld accepts many command options. For a brief summary, execute this command:
mysqld --helpTo see the full list, use this command:
mysqld --verbose --help
Some of the items in the list are actually system variables that
can be set at server startup. These can be displayed at runtime
using the SHOW VARIABLES statement.
Some items displayed by the preceding mysqld
command do not appear in SHOW
VARIABLES output; this is because they are options only
and not system variables.
The following list shows some of the most common server options. Additional options are described in other sections:
Options that affect security: See Section 8.1.4, “Security-Related mysqld Options and Variables”.
SSL-related options: See Command Options for Encrypted Connections.
Binary log control options: See Section 7.4.4, “The Binary Log”.
Replication-related options: See Section 19.1.6, “Replication and Binary Logging Options and Variables”.
Options for loading plugins such as pluggable storage engines: See Section 7.6.1, “Installing and Uninstalling Plugins”.
Options specific to particular storage engines: See Section 17.14, “InnoDB Startup Options and System Variables” and Section 18.2.1, “MyISAM Startup Options”.
Some options control the size of buffers or caches. For a given buffer, the server might need to allocate internal data structures. These structures typically are allocated from the total memory allocated to the buffer, and the amount of space required might be platform dependent. This means that when you assign a value to an option that controls a buffer size, the amount of space actually available might differ from the value assigned. In some cases, the amount might be less than the value assigned. It is also possible that the server adjusts a value upward. For example, if you assign a value of 0 to an option for which the minimal value is 1024, the server sets the value to 1024.
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.
Some options take file name values. Unless otherwise specified,
the default file location is the data directory if the value is a
relative path name. To specify the location explicitly, use an
absolute path name. Suppose that the data directory is
/var/mysql/data. If a file-valued option is
given as a relative path name, it is located under
/var/mysql/data. If the value is an absolute
path name, its location is as given by the path name.
You can also set the values of server system variables at server
startup by using variable names as options. To assign a value to a
server system variable, use an option of the form
--.
For example,
var_name=value--sort_buffer_size=384M sets the
sort_buffer_size variable to a
value of 384MB.
When you assign a value to a variable, MySQL might automatically correct the value to stay within a given range, or adjust the value to the closest permissible value if only certain values are permitted.
To restrict the maximum value to which a system variable can be
set at runtime with the
SET
statement, specify this maximum by using an option of the form
--maximum-
at server startup.
var_name=value
You can change the values of most system variables at runtime with
the SET
statement. See Section 15.7.6.1, “SET Syntax for Variable Assignment”.
Section 7.1.8, “Server System Variables”, provides a full description for all variables, and additional information for setting them at server startup and runtime. For information on changing system variables, see Section 7.1.1, “Configuring the Server”.
--help,-?Command-Line Format --helpDisplay a short help message and exit. Use both the
--verboseand--helpoptions to see the full message.-
Command-Line Format --allow-suspicious-udfs[={OFF|ON}]Type Boolean Default Value OFFThis option controls whether loadable functions that have only an
xxxsymbol for the main function can be loaded. By default, the option is off and only loadable functions that have at least one auxiliary symbol can be loaded; this prevents attempts at loading functions from shared object files other than those containing legitimate functions. See Loadable Function Security Precautions. -
Command-Line Format --ansiUse standard (ANSI) SQL syntax instead of MySQL syntax. For more precise control over the server SQL mode, use the
--sql-modeoption instead. See Section 1.7, “MySQL Standards Compliance”, and Section 7.1.11, “Server SQL Modes”. --basedir=,dir_name-bdir_nameCommand-Line Format --basedir=dir_nameSystem Variable basedirScope Global Dynamic No SET_VARHint AppliesNo Type Directory name Default Value parent of mysqld installation directoryThe path to the MySQL installation directory. This option sets the
basedirsystem variable.The server executable determines its own full path name at startup and uses the parent of the directory in which it is located as the default
basedirvalue. This in turn enables the server to use thatbasedirwhen searching for server-related information such as thesharedirectory containing error messages.-
Command-Line Format --check-table-functions=valueIntroduced 8.4.5 Type Enumeration Default Value ABORTValid Values WARNABORTWhen performing an upgade of the server, we scan the data dictionary for functions used in table constraints and other expressions, including
DEFAULTexpressions, partitioning expressions, and virtual columns. It is possible that a change in the behavior of the function causes it to raise an error in the new version of the server, where no such error occurred before in which case the table cannot be opened. This option provides a choice in how to handle such problems, according to which of the two values shown here is used:WARN: Log a warning for each table that cannot be opened.ABORT: Also logs a warning; in addition, the upgrade is stopped. This is the default. For a sufficiently high value of--log-error-verbosity, it also logs a note with a streamlined table definition listing only those expressions that potentially contain SQL functions.
The default behaviour is to abort the upgrade, so that the user can fix the issue using the older version of the server, before upgrading to the newer one. Use
WARNto continue the upgrade in interactive mode while reporting any issues.The
--check-table-functionsoption was introduced in MySQL 8.4.5. --chroot=,dir_name-rdir_nameCommand-Line Format --chroot=dir_nameType Directory name Put the mysqld server in a closed environment during startup by using the
chroot()system call. This is a recommended security measure. Use of this option somewhat limitsLOAD DATAandSELECT ... INTO OUTFILE.-
Command-Line Format --consolePlatform Specific Windows (Windows only.) Cause the default error log destination to be the console. This affects log sinks that base their own output destination on the default destination. See Section 7.4.2, “The Error Log”. mysqld does not close the console window if this option is used.
--consoletakes precedence over--log-errorif both are given. -
Command-Line Format --core-fileWhen this option is used, write a core file if mysqld dies; no arguments are needed (or accepted). The name and location of the core file is system dependent. On Linux, a core file named
core.is written to the current working directory of the process, which for mysqld is the data directory.pidpidrepresents the process ID of the server process. On macOS, a core file namedcore.is written to thepid/coresdirectory. On Solaris, use the coreadm command to specify where to write the core file and how to name it.For some systems, to get a core file you must also specify the
--core-file-sizeoption to mysqld_safe. See Section 6.3.2, “mysqld_safe — MySQL Server Startup Script”. On some systems, such as Solaris, you do not get a core file if you are also using the--useroption. There might be additional restrictions or limitations. For example, it might be necessary to execute ulimit -c unlimited before starting the server. Consult your system documentation.The
innodb_buffer_pool_in_core_filevariable can be used to reduce the size of core files on operating systems that support it. For more information, see Section 17.8.3.7, “Excluding or Including Buffer Pool Pages from Core Files”. --daemonize,-DCommand-Line Format --daemonize[={OFF|ON}]Type Boolean Default Value OFFThis option causes the server to run as a traditional, forking daemon, permitting it to work with operating systems that use systemd for process control. For more information, see Section 2.5.9, “Managing MySQL Server with systemd”.
--daemonizeis mutually exclusive with--initializeand--initialize-insecure.If the server is started using the
--daemonizeoption and is not connected to a tty device, a default error logging option of--log-error=""is used in the absence of an explicit logging option, to direct error output to the default log file.-Dis a synonym for--daemonize.--datadir=,dir_name-hdir_nameCommand-Line Format --datadir=dir_nameSystem Variable datadirScope Global Dynamic No SET_VARHint AppliesNo Type Directory name The path to the MySQL server data directory. This option sets the
datadirsystem variable. See the description of that variable.--debug[=,debug_options]-# [debug_options]Command-Line Format --debug[=debug_options]System Variable debugScope Global, Session Dynamic Yes SET_VARHint AppliesNo Type String Default Value (Unix) d:t:i:o,/tmp/mysqld.traceDefault Value (Windows) d:t:i:O,\mysqld.traceIf MySQL is configured with the
-DWITH_DEBUG=1CMake option, you can use this option to get a trace file of what mysqld is doing. A typicaldebug_optionsstring isd:t:o,. The default isfile_named:t:i:o,/tmp/mysqld.traceon Unix andd:t:i:O,\mysqld.traceon Windows.Using
-DWITH_DEBUG=1to configure MySQL with debugging support enables you to use the--debug="d,parser_debug"option when you start the server. This causes the Bison parser that is used to process SQL statements to dump a parser trace to the server's standard error output. Typically, this output is written to the error log.This option may be given multiple times. Values that begin with
+or-are added to or subtracted from the previous value. For example,--debug=T--debug=+Psets the value toP:T.For more information, see Section 7.9.4, “The DBUG Package”.
-
Command-Line Format --debug-sync-timeout[=#]Type Integer Controls whether the Debug Sync facility for testing and debugging is enabled. Use of Debug Sync requires that MySQL be configured with the
-DWITH_DEBUG=ONCMake option (see Section 2.8.7, “MySQL Source-Configuration Options”); otherwise, this option is not available. The option value is a timeout in seconds. The default value is 0, which disables Debug Sync. To enable it, specify a value greater than 0; this value also becomes the default timeout for individual synchronization points. If the option is given without a value, the timeout is set to 300 seconds.For a description of the Debug Sync facility and how to use synchronization points, see MySQL Internals: Test Synchronization.
-
Command-Line Format --default-time-zone=nameType String Set the default server time zone. This option sets the global
time_zonesystem variable. If this option is not given, the default time zone is the same as the system time zone (given by the value of thesystem_time_zonesystem variable.The
system_time_zonevariable differs fromtime_zone. Although they might have the same value, the latter variable is used to initialize the time zone for each client that connects. See Section 7.1.15, “MySQL Server Time Zone Support”. --defaults-extra-file=file_nameRead this option file after the global option file but (on Unix) before the user option file. If the file does not exist or is otherwise inaccessible, an error occurs. If
file_nameis not an absolute path name, it is interpreted relative to the current directory. This must be the first option on the command line if it is used.For additional information about this and other option-file options, see Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Read only the given option file. If the file does not exist or is otherwise inaccessible, an error occurs. If
file_nameis not an absolute path name, it is interpreted relative to the current directory.Exception: Even with
--defaults-file, mysqld readsmysqld-auto.cnf.NoteThis must be the first option on the command line if it is used, except that if the server is started with the
--defaults-fileand--install(or--install-manual) options,--install(or--install-manual) must be first.For additional information about this and other option-file options, see Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Read not only the usual option groups, but also groups with the usual names and a suffix of
str. For example, mysqld normally reads the[mysqld]group. If this option is given as--defaults-group-suffix=_other, mysqld also reads the[mysqld_other]group.For additional information about this and other option-file options, see Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.
--early-plugin-load=plugin_listCommand-Line Format --early-plugin-load=plugin_listType String Default Value empty stringThis option tells the server which plugins to load before loading mandatory built-in plugins and before storage engine initialization. Early loading is supported only for plugins compiled with
PLUGIN_OPT_ALLOW_EARLY. If multiple--early-plugin-loadoptions are given, only the last one applies.The option value is a semicolon-separated list of
plugin_libraryandname=plugin_libraryvalues. Eachplugin_libraryis the name of a library file that contains plugin code, and eachnameis the name of a plugin to load. If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. With a preceding plugin name, the server loads only the named plugin from the library. The server looks for plugin library files in the directory named by theplugin_dirsystem variable.For example, if plugins named
myplug1andmyplug2are contained in the plugin library filesmyplug1.soandmyplug2.so, use this option to perform an early plugin load:mysqld --early-plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"Quotes surround the argument value because otherwise some command interpreters interpret semicolon (
;) as a special character. (For example, Unix shells treat it as a command terminator.)Each named plugin is loaded early for a single invocation of mysqld only. After a restart, the plugin is not loaded early unless
--early-plugin-loadis used again.If the server is started using
--initializeor--initialize-insecure, plugins specified by--early-plugin-loadare not loaded.If the server is run with
--help, plugins specified by--early-plugin-loadare loaded but not initialized. This behavior ensures that plugin options are displayed in the help message.InnoDBtablespace encryption relies on the MySQL Keyring for encryption key management, and the keyring plugin to be used must be loaded prior to storage engine initialization to facilitateInnoDBrecovery for encrypted tables. For example, administrators who want thekeyring_okvplugin loaded at startup should use--early-plugin-loadwith the appropriate option value (such askeyring_okv.soon Unix and Unix-like systems orkeyring_okv.dllon Windows).For information about
InnoDBtablespace encryption, see Section 17.13, “InnoDB Data-at-Rest Encryption”. For general information about plugin loading, see Section 7.6.1, “Installing and Uninstalling Plugins”.NoteFor MySQL Keyring, this option is used only when the keystore is managed with a keyring plugin. If keystore management uses a keyring component rather than a plugin, specify component loading using a manifest file; see Section 8.4.4.2, “Keyring Component Installation”.
--exit-info[=,flags]-T [flags]Command-Line Format --exit-info[=flags]Type Integer This is a bitmask of different flags that you can use for debugging the mysqld server. Do not use this option unless you know exactly what it does!
-
Command-Line Format --external-locking[={OFF|ON}]Type Boolean Default Value OFFEnable external locking (system locking), which is disabled by default. If you use this option on a system on which
lockddoes not fully work (such as Linux), it is easy for mysqld to deadlock.To disable external locking explicitly, use
--skip-external-locking.External locking affects only
MyISAMtable access. For more information, including conditions under which it can and cannot be used, see Section 10.11.5, “External Locking”. -
Command-Line Format --flush[={OFF|ON}]System Variable flushScope Global Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value OFFFlush (synchronize) all changes to disk after each SQL statement. Normally, MySQL does a write of all changes to disk only after each SQL statement and lets the operating system handle the synchronizing to disk. See Section B.3.3.3, “What to Do If MySQL Keeps Crashing”.
NoteIf
--flushis specified, the value offlush_timedoes not matter and changes toflush_timehave no effect on flush behavior. -
Command-Line Format --gdb[={OFF|ON}]Type Boolean Default Value OFFInstall an interrupt handler for
SIGINT(needed to stop mysqld with^Cto set breakpoints) and disable stack tracing and core file handling. See Section 7.9.1.4, “Debugging mysqld under gdb”.On Windows, this option also suppresses the forking that is used to implement the
RESTARTstatement: Forking enables one process to act as a monitor to the other, which acts as the server. However, forking makes determining the server process to attach to for debugging more difficult, so starting the server with--gdbsuppresses forking. For a server started with this option,RESTARTsimply exits and does not restart.In non-debug settings,
--no-monitormay be used to suppress forking the monitor process. --initialize,-ICommand-Line Format --initialize[={OFF|ON}]Type Boolean Default Value OFFThis option is used to initialize a MySQL installation by creating the data directory and populating the tables in the
mysqlsystem schema. For more information, see Section 2.9.1, “Initializing the Data Directory”.This option limits the effects of, or is not compatible with, a number of other startup options for the MySQL server. Some of the most common issues of this sort are noted here:
We strongly recommend, when initializing the data directory with
--initialize, that you specify no additional options other than--datadir, other options used for setting directory locations such as--basedir, and possibly--user, if required. Options for the running MySQL server can be specified when starting it once initialization has been completed and mysqld has shut down. This also applies when using--initialize-insecureinstead of--initialize.When the server is started with
--initialize, some functionality is unavailable that limits the statements permitted in any file named by theinit_filesystem variable. For more information, see the description of that variable. In addition, thedisabled_storage_enginessystem variable has no effect.The
--ndbclusteroption is ignored when used together with--initialize.--initializeis mutually exclusive with--bootstrapand--daemonize.
The items in the preceding list also apply when initializing the server using the
--initialize-insecureoption.-
Command-Line Format --initialize-insecure[={OFF|ON}]Type Boolean Default Value OFFThis option is used to initialize a MySQL installation by creating the data directory and populating the tables in the
mysqlsystem schema. This option implies--initialize, and the same restrictions and limitations apply; for more information, see the description of that option, and Section 2.9.1, “Initializing the Data Directory”.WarningThis option creates a MySQL
rootuser with an empty password, which is insecure. For this reason, do not use it in production without setting this password manually. See Post-Initialization root Password Assignment, for information about how to do this. --innodb-xxxSet an option for the
InnoDBstorage engine. TheInnoDBoptions are listed in Section 17.14, “InnoDB Startup Options and System Variables”.-
Command-Line Format --install [service_name]Platform Specific Windows (Windows only) Install the server as a Windows service that starts automatically during Windows startup. The default service name is
MySQLif noservice_namevalue is given. For more information, see Section 2.3.3.8, “Starting MySQL as a Windows Service”.NoteIf the server is started with the
--defaults-fileand--installoptions,--installmust be first. --install-manual [service_name]Command-Line Format --install-manual [service_name]Platform Specific Windows (Windows only) Install the server as a Windows service that must be started manually. It does not start automatically during Windows startup. The default service name is
MySQLif noservice_namevalue is given. For more information, see Section 2.3.3.8, “Starting MySQL as a Windows Service”.NoteIf the server is started with the
--defaults-fileand--install-manualoptions,--install-manualmust be first.-
Command-Line Format --large-pages[={OFF|ON}]System Variable large_pagesScope Global Dynamic No SET_VARHint AppliesNo Platform Specific Linux Type Boolean Default Value OFFSome hardware/operating system architectures support memory pages greater than the default (usually 4KB). The actual implementation of this support depends on the underlying hardware and operating system. Applications that perform a lot of memory accesses may obtain performance improvements by using large pages due to reduced Translation Lookaside Buffer (TLB) misses.
MySQL supports the Linux implementation of large page support (which is called HugeTLB in Linux). See Section 10.12.3.3, “Enabling Large Page Support”. For Solaris support of large pages, see the description of the
--super-large-pagesoption.--large-pagesis disabled by default. -
Command-Line Format --lc-messages=nameSystem Variable lc_messagesScope Global, Session Dynamic Yes SET_VARHint AppliesNo Type String Default Value en_USThe locale to use for error messages. The default is
en_US. The server converts the argument to a language name and combines it with the value of--lc-messages-dirto produce the location for the error message file. See Section 12.12, “Setting the Error Message Language”. -
Command-Line Format --lc-messages-dir=dir_nameSystem Variable lc_messages_dirScope Global Dynamic No SET_VARHint AppliesNo Type Directory name The directory where error messages are located. The server uses the value together with the value of
--lc-messagesto produce the location for the error message file. See Section 12.12, “Setting the Error Message Language”. -
Command-Line Format --local-service(Windows only) A
--local-serviceoption following the service name causes the server to run using theLocalServiceWindows account that has limited system privileges. If both--defaults-fileand--local-serviceare given following the service name, they can be in any order. See Section 2.3.3.8, “Starting MySQL as a Windows Service”. -
Command-Line Format --log-error[=file_name]System Variable log_errorScope Global Dynamic No SET_VARHint AppliesNo Type File name Set the default error log destination to the named file. This affects log sinks that base their own output destination on the default destination. See Section 7.4.2, “The Error Log”.
If the option names no file, the default error log destination on Unix and Unix-like systems is a file named
in the data directory. The default destination on Windows is the same, unless thehost_name.err--pid-fileoption is specified. In that case, the file name is the PID file base name with a suffix of.errin the data directory.If the option names a file, the default destination is that file (with an
.errsuffix added if the name has no suffix), located under the data directory unless an absolute path name is given to specify a different location.If error log output cannot be redirected to the error log file, an error occurs and startup fails.
On Windows,
--consoletakes precedence over--log-errorif both are given. In this case, the default error log destination is the console rather than a file. -
Command-Line Format --log-isam[=file_name]Type File name Log all
MyISAMchanges to this file (used only when debuggingMyISAM). -
Command-Line Format --log-raw[={OFF|ON}]System Variable log_rawScope Global Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value OFFPasswords in certain statements written to the general query log, slow query log, and binary log are rewritten by the server not to occur literally in plain text. Password rewriting can be suppressed for the general query log by starting the server with the
--log-rawoption. This option may be useful for diagnostic purposes, to see the exact text of statements as received by the server, but for security reasons is not recommended for production use.If a query rewrite plugin is installed, the
--log-rawoption affects statement logging as follows:For more information, see Section 8.1.2.3, “Passwords and Logging”.
-
Command-Line Format --log-short-format[={OFF|ON}]Type Boolean Default Value OFFLog less information to the slow query log, if it has been activated.
-
Command-Line Format --log-tc=file_nameType File name Default Value tc.logThe name of the memory-mapped transaction coordinator log file (for XA transactions that affect multiple storage engines when the binary log is disabled). The default name is
tc.log. The file is created under the data directory if not given as a full path name. This option is unused. -
Command-Line Format --log-tc-size=#Type Integer Default Value 6 * page sizeMinimum Value 6 * page sizeMaximum Value (64-bit platforms) 18446744073709551615Maximum Value (32-bit platforms) 4294967295The size in bytes of the memory-mapped transaction coordinator log. The default and minimum values are 6 times the page size, and the value must be a multiple of the page size.
-
Command-Line Format --memlock[={OFF|ON}]Type Boolean Default Value OFFLock the mysqld process in memory. This option might help if you have a problem where the operating system is causing mysqld to swap to disk.
--memlockworks on systems that support themlockall()system call; this includes Solaris, most Linux distributions that use a 2.4 or higher kernel, and perhaps other Unix systems. On Linux systems, you can tell whether or notmlockall()(and thus this option) is supported by checking to see whether or not it is defined in the systemmman.hfile, like this:$> grep mlockall /usr/include/sys/mman.hIf
mlockall()is supported, you should see in the output of the previous command something like the following:extern int mlockall (int __flags) __THROW;ImportantUse of this option may require you to run the server as
root, which, for reasons of security, is normally not a good idea. See Section 8.1.5, “How to Run MySQL as a Normal User”.On Linux and perhaps other systems, you can avoid the need to run the server as
rootby changing thelimits.conffile. See the notes regarding the memlock limit in Section 10.12.3.3, “Enabling Large Page Support”.You must not use this option on a system that does not support the
mlockall()system call; if you do so, mysqld is very likely to exit as soon as you try to start it. -
Command-Line Format --myisam-block-size=#Type Integer Default Value 1024Minimum Value 1024Maximum Value 16384The block size to be used for
MyISAMindex pages. -
Command-Line Format --mysql-native-password={OFF|ON}Deprecated Yes Type Boolean Default Value OFFEnable the
mysql_native_passwordauthentication plugin, which is disabled by default in MySQL 8.4.For more information, see Section 8.4.1.1, “Native Pluggable Authentication”.
Do not read any option files. If program startup fails due to reading unknown options from an option file,
--no-defaultscan be used to prevent them from being read. This must be the first option on the command line if it is used.For additional information about this and other option-file options, see Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.
-
Command-Line Format --no-monitor[={OFF|ON}]Platform Specific Windows Type Boolean Default Value OFF(Windows only). This option suppresses the forking that is used to implement the
RESTARTstatement: Forking enables one process to act as a monitor to the other, which acts as the server. For a server started with this option,RESTARTsimply exits and does not restart. --performance-schema-xxxConfigure a Performance Schema option. For details, see Section 29.14, “Performance Schema Command Options”.
-
Command-Line Format --plugin-load=plugin_listType String This option tells the server to load the named plugins at startup. If multiple
--plugin-loadoptions are given, only the last one applies. Additional plugins to load may be specified using--plugin-load-addoptions.The option value is a semicolon-separated list of
plugin_libraryandname=plugin_libraryvalues. Eachplugin_libraryis the name of a library file that contains plugin code, and eachnameis the name of a plugin to load. If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. With a preceding plugin name, the server loads only the named plugin from the library. The server looks for plugin library files in the directory named by theplugin_dirsystem variable.For example, if plugins named
myplug1andmyplug2are contained in the plugin library filesmyplug1.soandmyplug2.so, use this option to perform an early plugin load:mysqld --plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"Quotes surround the argument value because otherwise some command interpreters interpret semicolon (
;) as a special character. (For example, Unix shells treat it as a command terminator.)Each named plugin is loaded for a single invocation of mysqld only. After a restart, the plugin is not loaded unless
--plugin-loadis used again. This is in contrast toINSTALL PLUGIN, which adds an entry to themysql.pluginstable to cause the plugin to be loaded for every normal server startup.During the normal startup sequence, the server determines which plugins to load by reading the
mysql.pluginssystem table. If the server is started with the--skip-grant-tablesoption, plugins registered in themysql.pluginstable are not loaded and are unavailable.--plugin-loadenables plugins to be loaded even when--skip-grant-tablesis given.--plugin-loadalso enables plugins to be loaded at startup that cannot be loaded at runtime.This option does not set a corresponding system variable. The output of
SHOW PLUGINSprovides information about loaded plugins. More detailed information can be found in the Information SchemaPLUGINStable. See Section 7.6.2, “Obtaining Server Plugin Information”.For additional information about plugin loading, see Section 7.6.1, “Installing and Uninstalling Plugins”.
-
Command-Line Format --plugin-load-add=plugin_listType String This option complements the
--plugin-loadoption.--plugin-load-addadds a plugin or plugins to the set of plugins to be loaded at startup. The argument format is the same as for--plugin-load.--plugin-load-addcan be used to avoid specifying a large set of plugins as a single long unwieldy--plugin-loadargument.--plugin-load-addcan be given in the absence of--plugin-load, but any instance of--plugin-load-addthat appears before--plugin-loadhas no effect because--plugin-loadresets the set of plugins to load. In other words, these options:--plugin-load=x --plugin-load-add=yare equivalent to this option:
--plugin-load="x;y"But these options:
--plugin-load-add=y --plugin-load=xare equivalent to this option:
--plugin-load=xThis option does not set a corresponding system variable. The output of
SHOW PLUGINSprovides information about loaded plugins. More detailed information can be found in the Information SchemaPLUGINStable. See Section 7.6.2, “Obtaining Server Plugin Information”.For additional information about plugin loading, see Section 7.6.1, “Installing and Uninstalling Plugins”.
Specifies an option that pertains to a server plugin. For example, many storage engines can be built as plugins, and for such engines, options for them can be specified with a
--pluginprefix. Thus, the--innodb-file-per-tableoption forInnoDBcan be specified as--plugin-innodb-file-per-table.For boolean options that can be enabled or disabled, the
--skipprefix and other alternative formats are supported as well (see Section 6.2.2.4, “Program Option Modifiers”). For example,--skip-plugin-innodb-file-per-tabledisablesinnodb-file-per-table.The rationale for the
--pluginprefix is that it enables plugin options to be specified unambiguously if there is a name conflict with a built-in server option. For example, were a plugin writer to name a plugin “sql” and implement a “mode” option, the option name might be--sql-mode, which would conflict with the built-in option of the same name. In such cases, references to the conflicting name are resolved in favor of the built-in option. To avoid the ambiguity, users can specify the plugin option as--plugin-sql-mode. Use of the--pluginprefix for plugin options is recommended to avoid any question of ambiguity.--port=,port_num-Pport_numCommand-Line Format --port=port_numSystem Variable portScope Global Dynamic No SET_VARHint AppliesNo Type Integer Default Value 3306Minimum Value 0Maximum Value 65535The port number to use when listening for TCP/IP connections. On Unix and Unix-like systems, the port number must be 1024 or higher unless the server is started by the
rootoperating system user. Setting this option to 0 causes the default value to be used.-
Command-Line Format --port-open-timeout=#Type Integer Default Value 0On some systems, when the server is stopped, the TCP/IP port might not become available immediately. If the server is restarted quickly afterward, its attempt to reopen the port can fail. This option indicates how many seconds the server should wait for the TCP/IP port to become free if it cannot be opened. The default is not to wait.
Print the program name and all options that it gets from option files. Password values are masked. This must be the first option on the command line if it is used, except that it may be used immediately after
--defaults-fileor--defaults-extra-file.For additional information about this and other option-file options, see Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.
-
Command-Line Format --remove [service_name]Platform Specific Windows (Windows only) Remove a MySQL Windows service. The default service name is
MySQLif noservice_namevalue is given. For more information, see Section 2.3.3.8, “Starting MySQL as a Windows Service”. -
Command-Line Format --safe-user-create[={OFF|ON}]Deprecated Yes Type Boolean Default Value OFFIf this option is enabled, a user cannot create new MySQL users by using the
GRANTstatement unless the user has theINSERTprivilege for themysql.usersystem table or any column in the table. If you want a user to have the ability to create new users that have those privileges that the user has the right to grant, you should grant the user the following privilege:GRANT INSERT(user) ON mysql.user TO 'user_name'@'host_name';This ensures that the user cannot change any privilege columns directly, but has to use the
GRANTstatement to give privileges to other users. -
Command-Line Format --skip-grant-tables[={OFF|ON}]Type Boolean Default Value OFFThis option affects the server startup sequence:
--skip-grant-tablescauses the server not to read the grant tables in themysqlsystem schema, and thus to start without using the privilege system at all. This gives anyone with access to the server unrestricted access to all databases.Because starting the server with
--skip-grant-tablesdisables authentication checks, the server also disables remote connections in that case by enablingskip_networking.To cause a server started with
--skip-grant-tablesto load the grant tables at runtime, perform a privilege-flushing operation, which can be done in these ways:Issue a MySQL
FLUSH PRIVILEGESstatement after connecting to the server.Execute a mysqladmin flush-privileges or mysqladmin reload command from the command line.
Privilege flushing might also occur implicitly as a result of other actions performed after startup, thus causing the server to start using the grant tables. For example, the server flushes the privileges if it performs an upgrade during the startup sequence.
--skip-grant-tablesdisables failed-login tracking and temporary account locking because those capabilities depend on the grant tables. See Section 8.2.15, “Password Management”.--skip-grant-tablescauses the server not to load certain other objects registered in the data dictionary or themysqlsystem schema:Scheduled events installed using
CREATE EVENTand registered in theeventsdata dictionary table.Plugins installed using
INSTALL PLUGINand registered in themysql.pluginsystem table.To cause plugins to be loaded even when using
--skip-grant-tables, use the--plugin-loador--plugin-load-addoption.Loadable functions installed using
CREATE FUNCTIONand registered in themysql.funcsystem table.
--skip-grant-tablesdoes not suppress loading during startup of components.--skip-grant-tablescauses thedisabled_storage_enginessystem variable to have no effect.
-
Command-Line Format --skip-newDeprecated Yes This option disables (what used to be considered) new, possibly unsafe behaviors. It results in these settings:
delay_key_write=OFF,concurrent_insert=NEVER,automatic_sp_privileges=OFF. It also causesOPTIMIZE TABLEto be mapped toALTER TABLEfor storage engines for whichOPTIMIZE TABLEis not supported.This option is deprecated, and subject to removal in a future release.
-
Command-Line Format --skip-show-databaseSystem Variable skip_show_databaseScope Global Dynamic No SET_VARHint AppliesNo Type Boolean Default Value OFFThis option sets the
skip_show_databasesystem variable that controls who is permitted to use theSHOW DATABASESstatement. See Section 7.1.8, “Server System Variables”. -
Command-Line Format --skip-stack-traceDo not write stack traces. This option is useful when you are running mysqld under a debugger. On some systems, you also must use this option to get a core file. See Section 7.9, “Debugging MySQL”.
-
Command-Line Format --slow-start-timeout=#Type Integer Default Value 15000This option controls the Windows service control manager's service start timeout. The value is the maximum number of milliseconds that the service control manager waits before trying to kill the windows service during startup. The default value is 15000 (15 seconds). If the MySQL service takes too long to start, you may need to increase this value. A value of 0 means there is no timeout.
-
Command-Line Format --socket={file_name|pipe_name}System Variable socketScope Global Dynamic No SET_VARHint AppliesNo Type String Default Value (Windows) MySQLDefault Value (Other) /tmp/mysql.sockOn Unix, this option specifies the Unix socket file to use when listening for local connections. The default value is
/tmp/mysql.sock. If this option is given, the server creates the file in the data directory unless an absolute path name is given to specify a different directory. On Windows, the option specifies the pipe name to use when listening for local connections that use a named pipe. The default value isMySQL(not case-sensitive). --sql-mode=value[,value[,value...]]Command-Line Format --sql-mode=nameSystem Variable sql_modeScope Global, Session Dynamic Yes SET_VARHint AppliesYes Type Set Default Value ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_ENGINE_SUBSTITUTIONValid Values ALLOW_INVALID_DATESANSI_QUOTESERROR_FOR_DIVISION_BY_ZEROHIGH_NOT_PRECEDENCEIGNORE_SPACENO_AUTO_VALUE_ON_ZERONO_BACKSLASH_ESCAPESNO_DIR_IN_CREATENO_ENGINE_SUBSTITUTIONNO_UNSIGNED_SUBTRACTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYPAD_CHAR_TO_FULL_LENGTHPIPES_AS_CONCATREAL_AS_FLOATSTRICT_ALL_TABLESSTRICT_TRANS_TABLESTIME_TRUNCATE_FRACTIONALSet the SQL mode. See Section 7.1.11, “Server SQL Modes”.
NoteMySQL installation programs may configure the SQL mode during the installation process.
If the SQL mode differs from the default or from what you expect, check for a setting in an option file that the server reads at startup.
-
Command-Line Format --standalonePlatform Specific Windows Available on Windows only; instructs the MySQL server not to run as a service.
-
Command-Line Format --super-large-pages[={OFF|ON}]Platform Specific Solaris Type Boolean Default Value OFFStandard use of large pages in MySQL attempts to use the largest size supported, up to 4MB. Under Solaris, a “super large pages” feature enables uses of pages up to 256MB. This feature is available for recent SPARC platforms. It can be enabled or disabled by using the
--super-large-pagesor--skip-super-large-pagesoption. --symbolic-links,--skip-symbolic-linksCommand-Line Format --symbolic-links[={OFF|ON}]Deprecated Yes Type Boolean Default Value OFFEnable or disable symbolic link support. On Unix, enabling symbolic links means that you can link a
MyISAMindex file or data file to another directory with theINDEX DIRECTORYorDATA DIRECTORYoption of theCREATE TABLEstatement. If you delete or rename the table, the files that its symbolic links point to also are deleted or renamed. See Section 10.12.2.2, “Using Symbolic Links for MyISAM Tables on Unix”.NoteSymbolic link support, along with the
--symbolic-linksoption that controls it, is deprecated; you should expect it to be removed in a future version of MySQL. In addition, the option is disabled by default. The relatedhave_symlinksystem variable also is deprecated; expect it to be removed in a future version of MySQL.This option has no meaning on Windows.
-
Command-Line Format --sysdate-is-now[={OFF|ON}]Type Boolean Default Value OFFSYSDATE()by default returns the time at which it executes, not the time at which the statement in which it occurs begins executing. This differs from the behavior ofNOW(). This option causesSYSDATE()to be a synonym forNOW(). For information about the implications for binary logging and replication, see the description forSYSDATE()in Section 14.7, “Date and Time Functions” and forSET TIMESTAMPin Section 7.1.8, “Server System Variables”. --tc-heuristic-recover={COMMIT|ROLLBACK}Command-Line Format --tc-heuristic-recover=nameType Enumeration Default Value OFFValid Values OFFCOMMITROLLBACKThe decision to use in a manual heuristic recovery.
If a
--tc-heuristic-recoveroption is specified, the server exits regardless of whether manual heuristic recovery is successful.On systems with more than one storage engine capable of two-phase commit, the
ROLLBACKoption is not safe and causes recovery to halt with the following error:[ERROR] --tc-heuristic-recover rollback strategy is not safe on systems with more than one 2-phase-commit-capable storage engine. Aborting crash recovery.-
Command-Line Format --transaction-isolation=nameSystem Variable transaction_isolationScope Global, Session Dynamic Yes SET_VARHint AppliesNo Type Enumeration Default Value REPEATABLE-READValid Values READ-UNCOMMITTEDREAD-COMMITTEDREPEATABLE-READSERIALIZABLESets the default transaction isolation level. The
levelvalue can beREAD-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ, orSERIALIZABLE. See Section 15.3.7, “SET TRANSACTION Statement”.The default transaction isolation level can also be set at runtime using the
SET TRANSACTIONstatement or by setting thetransaction_isolationsystem variable. -
Command-Line Format --transaction-read-only[={OFF|ON}]System Variable transaction_read_onlyScope Global, Session Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value OFFSets the default transaction access mode. By default, read-only mode is disabled, so the mode is read/write.
To set the default transaction access mode at runtime, use the
SET TRANSACTIONstatement or set thetransaction_read_onlysystem variable. See Section 15.3.7, “SET TRANSACTION Statement”. --tmpdir=,dir_name-tdir_nameCommand-Line Format --tmpdir=dir_nameSystem Variable tmpdirScope Global Dynamic No SET_VARHint AppliesNo Type Directory name The path of the directory to use for creating temporary files. It might be useful if your default
/tmpdirectory resides on a partition that is too small to hold temporary tables. This option accepts several paths that are used in round-robin fashion. Paths should be separated by colon characters (:) on Unix and semicolon characters (;) on Windows.--tmpdircan be a non-permanent location, such as a directory on a memory-based file system or a directory that is cleared when the server host restarts. If the MySQL server is acting as a replica, and you are using a non-permanent location for--tmpdir, consider setting a different temporary directory for the replica using thereplica_load_tmpdirsystem variable. For a replica, the temporary files used to replicateLOAD DATAstatements are stored in this directory, so with a permanent location they can survive machine restarts, although replication can now continue after a restart if the temporary files have been removed.For more information about the storage location of temporary files, see Section B.3.3.5, “Where MySQL Stores Temporary Files”.
-
Command-Line Format --upgrade=valueType Enumeration Default Value AUTOValid Values AUTONONEMINIMALFORCEThis option controls whether and how the server performs an automatic upgrade at startup. Automatic upgrade involves two steps:
Step 1: Data dictionary upgrade.
This step upgrades:
The data dictionary tables in the
mysqlschema. If the actual data dictionary version is lower than the current expected version, the server upgrades the data dictionary. If it cannot, or is prevented from doing so, the server cannot run.The Performance Schema and
INFORMATION_SCHEMA.
Step 2: Server upgrade.
This step comprises all other upgrade tasks. If the existing installation data has a lower MySQL version than the server expects, it must be upgraded:
The system tables in the
mysqlschema (the remaining non-data dictionary tables).The
sysschema.User schemas.
For details about upgrade steps 1 and 2, see Section 3.4, “What the MySQL Upgrade Process Upgrades”.
These
--upgradeoption values are permitted:AUTOThe server performs an automatic upgrade of anything it finds to be out of date (steps 1 and 2). This is the default action if
--upgradeis not specified explicitly.NONEThe server performs no automatic upgrade steps during the startup process (skips steps 1 and 2). Because this option value prevents a data dictionary upgrade, the server exits with an error if the data dictionary is found to be out of date:
[ERROR] [MY-013381] [Server] Server shutting down because upgrade is required, yet prohibited by the command line option '--upgrade=NONE'. [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.MINIMALThe server upgrades the data dictionary, the Performance Schema, and the
INFORMATION_SCHEMA, if necessary (step 1). Note that following an upgrade with this option, Group Replication cannot be started, because system tables on which the replication internals depend are not updated, and reduced functionality might also be apparent in other areas.FORCEThe server upgrades the data dictionary, the Performance Schema, and the
INFORMATION_SCHEMA, if necessary (step 1). In addition, the server forces an upgrade of everything else (step 2). Expect server startup to take longer with this option because the server checks all objects in all schemas.FORCEis useful to force step 2 actions to be performed if the server thinks they are not necessary. For example, you may believe that a system table is missing or has become damaged and want to force a repair.
The following table summarizes the actions taken by the server for each option value.
Option Value Server Performs Step 1? Server Performs Step 2? AUTOIf necessary If necessary NONENo No MINIMALIf necessary No FORCEIf necessary Yes --user={,user_name|user_id}-u {user_name|user_id}Command-Line Format --user=nameType String Run the mysqld server as the user having the name
user_nameor the numeric user IDuser_id. (“User” in this context refers to a system login account, not a MySQL user listed in the grant tables.)This option is mandatory when starting mysqld as
root. The server changes its user ID during its startup sequence, causing it to run as that particular user rather than asroot. See Section 8.1.1, “Security Guidelines”.To avoid a possible security hole where a user adds a
--user=rootoption to amy.cnffile (thus causing the server to run asroot), mysqld uses only the first--useroption specified and produces a warning if there are multiple--useroptions. Options in/etc/my.cnfand$MYSQL_HOME/my.cnfare processed before command-line options, so it is recommended that you put a--useroption in/etc/my.cnfand specify a value other thanroot. The option in/etc/my.cnfis found before any other--useroptions, which ensures that the server runs as a user other thanroot, and that a warning results if any other--useroption is found.-
Command-Line Format --validate-config[={OFF|ON}]Type Boolean Default Value OFFValidate the server startup configuration. If no errors are found, the server terminates with an exit code of 0. If an error is found, the server displays a diagnostic message and terminates with an exit code of 1. Warning and information messages may also be displayed, depending on the
log_error_verbosityvalue, but do not produce immediate validation termination or an exit code of 1. For more information, see Section 7.1.3, “Server Configuration Validation”. --validate-user-plugins[={OFF|ON}]Command-Line Format --validate-user-plugins[={OFF|ON}]Type Boolean Default Value ONIf this option is enabled (the default), the server checks each user account and produces a warning if conditions are found that would make the account unusable:
The account requires an authentication plugin that is not loaded.
The account requires the
sha256_password(deprecated) orcaching_sha2_passwordauthentication plugin but the server was started with neither SSL nor RSA enabled as required by the plugin.
Enabling
--validate-user-pluginsslows down server initialization andFLUSH PRIVILEGES. If you do not require the additional checking, you can disable this option at startup to avoid the performance decrement.Use this option with the
--helpoption for detailed help.--version,-VDisplay version information and exit.