When you start the mysqld server, you can specify program options using any of the methods described in Section 4.2.3, “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 4.2.6, “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.
An embedded MySQL server usually reads options from the
[server], [embedded], and
[
groups, where xxxxx_SERVER]xxxxx is the name of the
application into which the server is embedded.
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 6.1.4, “Security-Related mysqld Options and Variables”.
SSL-related options: See Section 6.4.5, “Command Options for Secure Connections”.
Binary log control options: See Section 5.4.4, “The Binary Log”.
Replication-related options: See Section 16.1.6, “Replication and Binary Logging Options and Variables”.
Options for loading plugins such as pluggable storage engines: See Section 5.5.2, “Installing and Uninstalling Plugins”.
Options specific to particular storage engines: See Section 14.14, “InnoDB Startup Options and System Variables” and Section 15.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 will adjust a value upward. For example, if you assign a value of 0 to an option for which the minimal value is 1024, the server will set 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 will be 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 13.7.4.1, “SET Syntax for Variable Assignment”.
Section 5.1.5, “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 5.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-udfsPermitted Values Type boolean Default FALSEThis option controls whether user-defined functions that have only an
xxxsymbol for the main function can be loaded. By default, the option is off and only UDFs 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 UDFs. See Section 28.4.2.6, “UDF 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.8, “MySQL Standards Compliance”, and Section 5.1.8, “Server SQL Modes”. --basedir=,dir_name-bdir_nameCommand-Line Format --basedir=dir_nameSystem Variable Name basedirVariable Scope Global Dynamic Variable No Permitted Values Type directory name The path to the MySQL installation directory. This option sets the
basedirsystem variable.-
Command-Line Format --big-tablesSystem Variable Name big_tablesVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type boolean Default OFFEnable large result sets by saving all temporary sets in files. This option prevents most “table full” errors, but also slows down queries for which in-memory tables would suffice. The server is able to handle large result sets automatically by using memory for small temporary tables and switching to disk tables where necessary.
-
Command-Line Format --bind-address=addrSystem Variable Name bind_addressVariable Scope Global Dynamic Variable No Permitted Values Type string Default *The MySQL server listens on a single network socket for TCP/IP connections. This socket is bound to a single address, but it is possible for an address to map onto multiple network interfaces. To specify an address, use the
--bind-address=option at server startup, whereaddraddris an IPv4 or IPv6 address or a host name. Ifaddris a host name, the server resolves the name to an IP address and binds to that address.The server treats different types of addresses as follows:
If the address is
*, the server accepts TCP/IP connections on all server host IPv6 and IPv4 interfaces if the server host supports IPv6, or accepts TCP/IP connections on all IPv4 addresses otherwise. Use this address to permit both IPv4 and IPv6 connections on all server interfaces. This value is the default.If the address is
0.0.0.0, the server accepts TCP/IP connections on all server host IPv4 interfaces.If the address is
::, the server accepts TCP/IP connections on all server host IPv4 and IPv6 interfaces.If the address is an IPv4-mapped address, the server accepts TCP/IP connections for that address, in either IPv4 or IPv6 format. For example, if the server is bound to
::ffff:127.0.0.1, clients can connect using--host=127.0.0.1or--host=::ffff:127.0.0.1.If the address is a “regular” IPv4 or IPv6 address (such as
127.0.0.1or::1), the server accepts TCP/IP connections only for that IPv4 or IPv6 address.
If you intend to bind the server to a specific address, be sure that the
mysql.usergrant table contains an account with administrative privileges that you can use to connect to that address. Otherwise, you will not be able to shut down the server. For example, if you bind the server to*, you can connect to it using all existing accounts. But if you bind the server to::1, it accepts connections only on that address. In that case, first make sure that the'root'@'::1'account is present in themysql.usertable so you can still connect to the server to shut it down. --binlog-format={ROW|STATEMENT|MIXED}Command-Line Format --binlog-format=formatSystem Variable Name binlog_formatVariable Scope Global, Session Dynamic Variable Yes Permitted Values (<= 5.7.6) Type enumeration Default STATEMENTValid Values ROWSTATEMENTMIXEDPermitted Values (>= 5.7.7) Type enumeration Default ROWValid Values ROWSTATEMENTMIXEDSpecify whether to use row-based, statement-based, or mixed replication. Statement-based is the default in MySQL 5.7. See Section 16.2.1, “Replication Formats”.
Under some conditions, changing this variable at runtime is not possible, or causes replication to fail. See Section 5.4.4.2, “Setting The Binary Log Format”, for more information.
Setting the binary logging format without enabling binary logging sets the
binlog_formatglobal system variable and logs a warning.-
Deprecated 5.7.6 Command-Line Format --bootstrapThis option is used by the mysql_install_db program to create the MySQL privilege tables without having to start a full MySQL server.
Notemysql_install_db is deprecated because its functionality has been integrated into mysqld, the MySQL server. Consequently, the
--bootstrapserver option that mysql_install_db passes to mysqld is also deprecated. To initialize a MySQL installation, invoke mysqld with the--initializeor--initialize-insecureoption. For more information, see Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”. mysql_install_db and the--bootstrapserver option will be removed in a future MySQL release.--bootstrapis mutually exclusive with--daemonize,--initialize, and--initialize-insecure.Global transaction identifiers (GTIDs) are not disabled when
--bootstrapis used.--bootstrapwas used (Bug #20980271). See Section 16.1.3, “Replication with Global Transaction Identifiers”.When the server operates in bootstap mode, some functionality is unavailable that limits the statements permitted in any file named by the
--init-fileoption. For more information, see the description of that option. In addition, thedisabled_storage_enginessystem variable has no effect. -
Command-Line Format --character-sets-dir=dir_nameSystem Variable Name character_sets_dirVariable Scope Global Dynamic Variable No Permitted Values Type directory name The directory where character sets are installed. See Section 10.5, “Character Set Configuration”.
--character-set-client-handshakeCommand-Line Format --character-set-client-handshakePermitted Values Type boolean Default TRUEDo not ignore character set information sent by the client. To ignore client information and use the default server character set, use
--skip-character-set-client-handshake; this makes MySQL behave like MySQL 4.0.--character-set-filesystem=charset_nameCommand-Line Format --character-set-filesystem=nameSystem Variable Name character_set_filesystemVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type string Default binaryThe file system character set. This option sets the
character_set_filesystemsystem variable.--character-set-server=,charset_name-Ccharset_nameCommand-Line Format --character-set-serverSystem Variable Name character_set_serverVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type string Default latin1Use
charset_nameas the default server character set. See Section 10.5, “Character Set Configuration”. If you use this option to specify a nondefault character set, you should also use--collation-serverto specify the collation.--chroot=,dir_name-rdir_nameCommand-Line Format --chroot=dir_namePermitted Values Type 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 DATA INFILEandSELECT ... INTO OUTFILE.--collation-server=collation_nameCommand-Line Format --collation-serverSystem Variable Name collation_serverVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type string Default latin1_swedish_ciUse
collation_nameas the default server collation. See Section 10.5, “Character Set Configuration”.-
Command-Line Format --consolePlatform Specific Windows (Windows only.) Write error log messages to
stderrandstdouteven if--log-erroris specified. mysqld does not close the console window if this option is used.If both
--log-errorand--consoleare specified,--consoletakes precedence. The server writes to the console, but not to the log file. (In MySQL 5.5 and 5.6, the precedence is reversed:--log-errorcauses--consoleto be ignored.) -
Command-Line Format --core-filePermitted Values Type boolean Default OFFWrite a core file if mysqld dies. 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 OS X, 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 4.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. -
Introduced 5.7.6 Command-Line Format --daemonize[={OFF|ON}]Permitted Values Type boolean Default 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.10, “Managing MySQL Server with systemd”.
--daemonizeis mutually exclusive with--bootstrap,--initialize, and--initialize-insecure. --datadir=,dir_name-hdir_nameCommand-Line Format --datadir=dir_nameSystem Variable Name datadirVariable Scope Global Dynamic Variable No Permitted Values 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 Name debugVariable Scope Global, Session Dynamic Variable Yes Permitted Values (Unix) Type string Default d:t:i:o,/tmp/mysqld.tracePermitted Values (Windows) Type string Default 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 28.5.3, “The DBUG Package”.
-
Command-Line Format --debug-sync-timeout[=#]Permitted Values 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
-DENABLE_DEBUG_SYNC=1CMake option (see Section 2.9.4, “MySQL Source-Configuration Options”). If Debug Sync is not compiled in, 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.
--default-authentication-plugin=plugin_nameRemoved 5.7.2 Command-Line Format --default-authentication-plugin=plugin_namePermitted Values Type enumeration Default mysql_native_passwordValid Values mysql_native_passwordsha256_passwordThis option sets the default authentication plugin. It was removed in MySQL 5.7.2 and replaced by the
default_authentication_pluginsystem variable. The variable is used the same way as the option at server startup, but also enables the default plugin value to be inspected as runtime. For usage details, see the description ofdefault_authentication_plugin.-
Command-Line Format --default-storage-engine=nameSystem Variable Name default_storage_engineVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type enumeration Default InnoDBSet the default storage engine for tables. See Chapter 15, Alternative Storage Engines. This option sets the storage engine for permanent tables only. To set the storage engine for
TEMPORARYtables, set thedefault_tmp_storage_enginesystem variable.If you disable the default storage engine at server startup, you must set the default engine for both permanent and
TEMPORARYtables to a different engine or the server will not start. -
Command-Line Format --default-time-zone=namePermitted Values Type 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. --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.
file_nameis interpreted relative to the current directory if given as a relative path name rather than a full path name. This must be the first option on the command line if it is used.For additional information about this option, see Section 4.2.7, “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.
file_nameis interpreted relative to the current directory if given as a relative path name rather than a full path name.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 option, see Section 4.2.7, “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 the--defaults-group-suffix=_otheroption is given, mysqld also reads the[mysqld_other]group.For additional information about this option, see Section 4.2.7, “Command-Line Options that Affect Option-File Handling”.
--delay-key-write[={OFF|ON|ALL}]Command-Line Format --delay-key-write[=name]System Variable Name delay_key_writeVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default ONValid Values ONOFFALLSpecify how to use delayed key writes. Delayed key writing causes key buffers not to be flushed between writes for
MyISAMtables.OFFdisables delayed key writes.ONenables delayed key writes for those tables that were created with theDELAY_KEY_WRITEoption.ALLdelays key writes for allMyISAMtables. See Section 5.1.1, “Configuring the Server”, and Section 15.2.1, “MyISAM Startup Options”.NoteIf you set this variable to
ALL, you should not useMyISAMtables from within another program (such as another MySQL server or myisamchk) when the tables are in use. Doing so leads to index corruption.-
Command-Line Format --des-key-file=file_nameRead the default DES keys from this file. These keys are used by the
DES_ENCRYPT()andDES_DECRYPT()functions. --disable-partition-engine-checkIntroduced 5.7.17 Deprecated 5.7.17 Command-Line Format --disable-partition-engine-checkWhether to disable the startup check for tables with nonnative partitioning.
As of MySQL 5.7.17, the generic partitioning handler in the MySQL server is deprecated, and is removed in MySQL 8.0, when the storage engine used for a given table is expected to provide its own (“native”) partitioning handler. Currently, only the
InnoDBandNDBstorage engines do.Use of tables with nonnative partitioning results in an
ER_WARN_DEPRECATED_SYNTAXwarning. Also, the server performs a check at startup to identify tables that use nonnative partitioning; for any found, the server writes a message to its error log. To disable this check, use the--disable-partition-engine-checkoption.To prepare for migration to MySQL 8.0, any table with nonnative partitioning should be changed to use an engine that provides native partitioning, or be made nonpartitioned. For example, to change a table to
InnoDB, execute this statement:ALTER TABLE table_name ENGINE = INNODB;--early-plugin-load=plugin_listIntroduced 5.7.11 Command-Line Format --early-plugin-load=plugin_listPermitted Values (5.7.11) Type string Default keyring_file plugin library file namePermitted Values (>= 5.7.12) Type string Default empty stringThis option tells the server which plugins to load before loading mandatory built-in plugins and before storage engine initialization. If multiple
--early-plugin-loadoptions are given, only the last one is used.The option value is a semicolon-separated list of
name=plugin_libraryandplugin_libraryvalues. Eachnameis the name of a plugin to load, andplugin_libraryis the name of the library file that contains the plugin code. If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. The server looks for plugin library files in the directory named by theplugin_dirsystem variable.For example, if plugins named
myplug1andmyplug2have library filesmyplug1.soandmyplug2.so, use this option to perform an early plugin load:shell> mysqld --early-plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"Quotes are used around the argument value because otherwise a semicolon (
;) is interpreted as a special character by some command interpreters. (Unix shells treat it as a command terminator, for example.)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.As of MySQL 5.7.12, the default
--early-plugin-loadvalue is empty. To load your chosen keyring plugin, you must use an explicit--early-plugin-loadoption with a nonempty value.ImportantIn MySQL 5.7.11, the default
--early-plugin-loadvalue was the name of thekeyring_fileplugin library file, so that plugin was loaded by default.InnoDBtablespace encryption requires thekeyring_fileplugin to be loaded prior toInnoDBinitialization, so this change of default--early-plugin-loadvalue introduces an incompatibility for upgrades from 5.7.11 to 5.7.12 or higher. Administrators who have encryptedInnoDBtablespaces must take explicit action to ensure continued loading of thekeyring_fileplugin: Start the server with an--early-plugin-loadoption that names the plugin library file. For additional information, see Section 6.5.4.1, “Keyring Plugin Installation”.The
InnoDBtablespace encryption feature relies on thekeyring_fileplugin for encryption key management, and thekeyring_fileplugin must be loaded prior to storage engine initialization to facilitateInnoDBrecovery for encrypted tables. In MySQL 5.7.11, if you do not want to load thekeyring_fileplugin at server startup, specify an empty string (--early-plugin-load="").For information about
InnoDBtablespace encryption, see Section 14.7.10, “InnoDB Tablespace Encryption”. For general information about plugin loading, see Section 5.5.2, “Installing and Uninstalling Plugins”.-
Command-Line Format --enable-named-pipePlatform Specific Windows Enable support for named pipes. This option applies only on Windows.
-
Command-Line Format --event-scheduler[=value]System Variable Name event_schedulerVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default OFFValid Values ONOFFDISABLEDEnable or disable, and start or stop, the event scheduler.
For detailed information, see The
--event-schedulerOption. --exit-info[=,flags]-T [flags]Command-Line Format --exit-info[=flags]Permitted Values 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-lockingPermitted Values Type boolean Default FALSEEnable 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 8.11.5, “External Locking”. -
Command-Line Format --flushSystem Variable Name flushVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default 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.5.3.3, “What to Do If MySQL Keeps Crashing”.
-
Command-Line Format --gdbPermitted Values Type boolean Default FALSEInstall an interrupt handler for
SIGINT(needed to stop mysqld with^Cto set breakpoints) and disable stack tracing and core file handling. See Section 28.5, “Debugging and Porting MySQL”. -
Command-Line Format --general-logSystem Variable Name general_logVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFSpecify the initial general query log state. With no argument or an argument of 1, the
--general-logoption enables the log. If omitted or given with an argument of 0, the option disables the log. -
Command-Line Format --ignore-db-dirPermitted Values Type directory name This option tells the server to ignore the given directory name for purposes of the
SHOW DATABASESstatement orINFORMATION_SCHEMAtables. For example, if a MySQL configuration locates the data directory at the root of a file system on Unix, the system might create alost+founddirectory there that the server should ignore. Starting the server with--ignore-db-dir=lost+foundcauses that name not to be listed as a database.To specify more than one name, use this option multiple times, once for each name. Specifying the option with an empty value (that is, as
--ignore-db-dir=) resets the directory list to the empty list.Instances of this option given at server startup are used to set the
ignore_db_dirssystem variable. -
Introduced 5.7.6 Command-Line Format --initializePermitted Values Type boolean Default OFFThis option is used to initialize a MySQL installation by creating the data directory and populating the tables in the
mysqlsystem database. For more information, see Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.When the server is started with
--initialize, some functionality is unavailable that limits the statements permitted in any file named by the--init-fileoption. For more information, see the description of that option. In addition, thedisabled_storage_enginessystem variable has no effect.In MySQL NDB Cluster 7.5.4 and later, the
--ndbclusteroption is ignored when used together with--initialize. (Bug #81689, Bug #23518923)In MySQL 5.7.7 and earlier, global transaction identifiers (GTIDs) were automatically disabled whenever
--initializewas enabled. In MySQL 5.7.8 and later GTIDs are not disabled when--initializeis enabled.--initializeis mutually exclusive with--bootstrapand--daemonize. -
Introduced 5.7.6 Command-Line Format --initialize-insecurePermitted Values Type boolean Default OFFThis option is used to initialize a MySQL installation by creating the data directory and populating the tables in the
mysqlsystem database. This option implies--initialize. For more information, see the description of that option, and Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.--initialize-insecureis mutually exclusive with--bootstrapand--daemonize. -
Command-Line Format --init-file=file_nameSystem Variable Name init_fileVariable Scope Global Dynamic Variable No Permitted Values Type file name Read SQL statements from this file at startup. Each statement must be on a single line and should not include comments.
If the server is started with any of the
--bootstrap,--initialize, or--initialize-insecureoptions, it operates in bootstap mode and some functionality is unavailable that limits the statements permitted in the file. These include statements that relate to account management (such asCREATE USERorGRANT), replication, and global transaction identifiers. See Section 16.1.3, “Replication with Global Transaction Identifiers”. --innodb-xxxSet an option for the
InnoDBstorage engine. TheInnoDBoptions are listed in Section 14.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.5.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.5.8, “Starting MySQL as a Windows Service”.NoteIf the server is started with the
--defaults-fileand--install-manualoptions,--install-manualmust be first.--language=lang_name, -Llang_nameDeprecated 5.6.1, by lc-messages-dirCommand-Line Format --language=nameSystem Variable Name languageVariable Scope Global Dynamic Variable No Permitted Values Type directory name Default /usr/local/mysql/share/mysql/english/The language to use for error messages.
lang_namecan be given as the language name or as the full path name to the directory where the language files are installed. See Section 10.2, “Setting the Error Message Language”.--lc-messages-dirand--lc-messagesshould be used rather than--language, which is deprecated (and handled as an alias for--lc-messages-dir). The--languageoption will be removed in a future MySQL release.-
Command-Line Format --large-pagesSystem Variable Name large_pagesVariable Scope Global Dynamic Variable No Platform Specific Linux Permitted Values (Linux) Type boolean Default FALSESome 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 8.12.4.2, “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 Name lc_messagesVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type string Default 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 10.2, “Setting the Error Message Language”. -
Command-Line Format --lc-messages-dir=dir_nameSystem Variable Name lc_messages_dirVariable Scope Global Dynamic Variable No Permitted Values 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 10.2, “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.5.8, “Starting MySQL as a Windows Service”. -
Command-Line Format --log-error[=file_name]System Variable Name log_errorVariable Scope Global Dynamic Variable No Permitted Values Type file name Log errors and startup messages to this file. See Section 5.4.2, “The Error Log”. If the file name has no extension, the server adds an extension of
.err. If you omit the file name, the default log file on Unix and Unix-like systems isin the data directory. The default on Windows ishost_name.errin the data directory, unless thehost_name.err--pid-fileoption is specified. In that case, the default name is the PID file base name with a suffix of.errin the data directory. -
Command-Line Format --log-isam[=file_name]Permitted Values Type file name Log all
MyISAMchanges to this file (used only when debuggingMyISAM). -
Command-Line Format --log-output=nameSystem Variable Name log_outputVariable Scope Global Dynamic Variable Yes Permitted Values Type set Default FILEValid Values TABLEFILENONEThis option determines the destination for general query log and slow query log output. The option value can be given as one or more of the words
TABLE,FILE, orNONE.TABLEselect logging to thegeneral_logandslow_logtables in themysqldatabase as a destination.FILEselects logging to log files as a destination.NONEdisables logging. IfNONEis present in the option value, it takes precedence over any other words that are present.TABLEandFILEcan both be given to select to both log output destinations.This option selects log output destinations, but does not enable log output. To do that, use the
--general_logand--slow_query_logoptions. ForFILElogging, the--general_log_fileand-slow_query_log_fileoptions determine the log file location. For more information, see Section 5.4.1, “Selecting General Query and Slow Query Log Output Destinations”. --log-queries-not-using-indexesCommand-Line Format --log-queries-not-using-indexesSystem Variable Name log_queries_not_using_indexesVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFIf you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section 5.4.5, “The Slow Query Log”. This option does not necessarily mean that no index is used. For example, a query that uses a full index scan uses an index but would be logged because the index would not limit the number of rows.
-
Command-Line Format --log-raw[=value]Permitted Values Type boolean Default 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 6.1.2.3, “Passwords and Logging”.
-
Command-Line Format --log-short-formatPermitted Values Type boolean Default FALSELog less information to the slow query log, if it has been activated.
-
Removed 5.7.1 Command-Line Format --log-slow-admin-statements(5.7.0)Permitted Values Type boolean Default OFFInclude slow administrative statements in the statements written to the slow query log. Administrative statements include
ALTER TABLE,ANALYZE TABLE,CHECK TABLE,CREATE INDEX,DROP INDEX,OPTIMIZE TABLE, andREPAIR TABLE.This command-line option was removed in MySQL 5.7.1 and replaced by the
log_slow_admin_statementssystem variable. The system variable can be set on the command line or in option files the same way as the option, so there is no need for any changes at server startup, but the system variable also makes it possible to examine or set the value at runtime. -
Command-Line Format --log-tc=file_namePermitted Values Type file name Default 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=#Permitted Values (32-bit platforms) Type integer Default 24576Max Value 4294967295Permitted Values (64-bit platforms) Type integer Default 24576Max Value 18446744073709551615The size in bytes of the memory-mapped transaction coordinator log. The default size is 24KB.
--log-warnings[=,level]-W [level]Deprecated 5.7.2 Command-Line Format --log-warnings[=#]System Variable Name log_warningsVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms, <= 5.7.1) Type integer Default 1Min Value 0Max Value 4294967295Permitted Values (32-bit platforms, >= 5.7.2) Type integer Default 2Min Value 0Max Value 4294967295Permitted Values (64-bit platforms, <= 5.7.1) Type integer Default 1Min Value 0Max Value 18446744073709551615Permitted Values (64-bit platforms, >= 5.7.2) Type integer Default 2Min Value 0Max Value 18446744073709551615NoteAs of MySQL 5.7.2, the
log_error_verbositysystem variable is preferred over, and should be used instead of, the--log-warningsoption orlog_warningssystem variable. For more information, see the descriptions oflog_error_verbosityandlog_warnings. The--log-warningscommand-line option andlog_warningssystem variable are deprecated and will be removed in a future MySQL release.Whether to produce additional warning messages to the error log. This option is enabled by default (the default is 1 before MySQL 5.7.2, 2 as of 5.7.2). To disable it, use
--log-warnings=0. Specifying the option without alevelvalue increments the current value by 1. The server logs messages about statements that are unsafe for statement-based logging if the value is greater than 0. Aborted connections and access-denied errors for new connection attempts are logged if the value is greater than 1. See Section B.5.2.11, “Communication Errors and Aborted Connections”.-
Command-Line Format --low-priority-updatesSystem Variable Name low_priority_updatesVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type boolean Default FALSEGive table-modifying operations (
INSERT,REPLACE,DELETE,UPDATE) lower priority than selects. This can also be done using{INSERT | REPLACE | DELETE | UPDATE} LOW_PRIORITY ...to lower the priority of only one query, or bySET LOW_PRIORITY_UPDATES=1to change the priority in one thread. This affects only storage engines that use only table-level locking (MyISAM,MEMORY,MERGE). See Section 8.11.2, “Table Locking Issues”. --min-examined-row-limit=numberCommand-Line Format --min-examined-row-limit=#System Variable Name min_examined_row_limitVariable Scope Global, Session Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default 0Min Value 0Max Value 4294967295Permitted Values (64-bit platforms) Type integer Default 0Min Value 0Max Value 18446744073709551615When this option is set, queries which examine fewer than
numberrows are not written to the slow query log. The default is 0.-
Command-Line Format --memlockPermitted Values Type boolean Default FALSELock 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:shell> 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 6.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 8.12.4.2, “Enabling Large Page Support”.You must not try to use this option on a system that does not support the
mlockall()system call; if you do so, mysqld will very likely crash as soon as you try to start it. -
Command-Line Format --myisam-block-size=#Permitted Values Type integer Default 1024Min Value 1024Max Value 16384The block size to be used for
MyISAMindex pages. --myisam-recover-options[=option[,option]...]]Command-Line Format --myisam-recover-options[=name]Permitted Values Type enumeration Default OFFValid Values OFFDEFAULTBACKUPFORCEQUICKSet the
MyISAMstorage engine recovery mode. The option value is any combination of the values ofOFF,DEFAULT,BACKUP,FORCE, orQUICK. If you specify multiple values, separate them by commas. Specifying the option with no argument is the same as specifyingDEFAULT, and specifying with an explicit value of""disables recovery (same as a value ofOFF). If recovery is enabled, each time mysqld opens aMyISAMtable, it checks whether the table is marked as crashed or was not closed properly. (The last option works only if you are running with external locking disabled.) If this is the case, mysqld runs a check on the table. If the table was corrupted, mysqld attempts to repair it.The following options affect how the repair works.
Option Description OFFNo recovery. DEFAULTRecovery without backup, forcing, or quick checking. BACKUPIf the data file was changed during recovery, save a backup of the file astbl_name.MYD.tbl_name-datetime.BAKFORCERun recovery even if we would lose more than one row from the .MYDfile.QUICKDo not check the rows in the table if there are not any delete blocks. Before the server automatically repairs a table, it writes a note about the repair to the error log. If you want to be able to recover from most problems without user intervention, you should use the options
BACKUP,FORCE. This forces a repair of a table even if some rows would be deleted, but it keeps the old data file as a backup so that you can later examine what happened.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 option, see Section 4.2.7, “Command-Line Options that Affect Option-File Handling”.
-
Command-Line Format --old-alter-tableSystem Variable Name old_alter_tableVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type boolean Default OFFWhen this option is given, the server does not use the optimized method of processing an
ALTER TABLEoperation. It reverts to using a temporary table, copying over the data, and then renaming the temporary table to the original, as used by MySQL 5.0 and earlier. For more information on the operation ofALTER TABLE, see Section 13.1.8, “ALTER TABLE Syntax”. -
Command-Line Format --old-style-user-limitsPermitted Values Type boolean Default FALSEEnable old-style user limits. (Before MySQL 5.0.3, account resource limits were counted separately for each host from which a user connected rather than per account row in the
usertable.) See Section 6.3.5, “Setting Account Resource Limits”. -
Command-Line Format --open-files-limit=#System Variable Name open_files_limitVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 5000, with possible adjustmentMin Value 0Max Value platform dependentChanges the number of file descriptors available to mysqld. You should try increasing the value of this option if mysqld gives you the error
Too many open files. mysqld uses the option value to reserve descriptors withsetrlimit(). Internally, the maximum value for this option is the maximum unsigned integer value, but the actual maximum is platform dependent. If the requested number of file descriptors cannot be allocated, mysqld writes a warning to the error log.mysqld may attempt to allocate more than the requested number of descriptors (if they are available), using the values of
max_connectionsandtable_open_cacheto estimate whether more descriptors will be needed.On Unix, the value cannot be set greater than ulimit -n.
-
Deprecated 5.7.16 Command-Line Format --partitionDisabled by skip-partitionPermitted Values Type boolean Default ONEnables or disables user-defined partitioning support in the MySQL Server.
This option is deprecated in MySQL 5.7.16, and is removed from MySQL 8.0.
--performance-schema-xxxConfigure a Performance Schema option. For details, see Section 25.13, “Performance Schema Command Options”.
-
Command-Line Format --pid-file=file_nameSystem Variable Name pid_fileVariable Scope Global Dynamic Variable No Permitted Values Type file name The path name of the process ID file. The server creates the file in the data directory unless an absolute path name is given to specify a different directory. This file is used by other programs such as mysqld_safe to determine the server's process ID. On Windows, this variable also affects the default error log file name. See Section 5.4.2, “The Error Log”
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 4.2.5, “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.-
Command-Line Format --plugin-load=plugin_listPermitted Values Type string This option tells the server to load the named plugins at startup. If multiple
--plugin-loadoptions are given, only the last one is used. Additional plugins to load may be specified using--plugin-load-addoptions.The option value is a semicolon-separated list of
name=plugin_libraryandplugin_libraryvalues. Eachnameis the name of a plugin to load, andplugin_libraryis the name of the library file that contains the plugin code. If a plugin library is named without any preceding plugin name, the server loads all plugins in the library. The server looks for plugin library files in the directory named by theplugin_dirsystem variable.For example, if plugins named
myplug1andmyplug2have library filesmyplug1.soandmyplug2.so, use this option to perform an early plugin load:shell> mysqld --plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"Quotes are used around the argument value here because otherwise semicolon (
;) is interpreted as a special character by some command interpreters. (Unix shells treat it as a command terminator, for example.)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.Under normal startup, the server determines which plugins to load by reading the
mysql.pluginssystem table. If the server is started with the--skip-grant-tablesoption, it does not consult themysql.pluginstable and does not load plugins listed there.--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.For additional information about plugin loading, see Section 5.5.2, “Installing and Uninstalling Plugins”.
-
Command-Line Format --plugin-load-add=plugin_listPermitted Values Type 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-load. has 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=xFor additional information about plugin loading, see Section 5.5.2, “Installing and Uninstalling Plugins”.
--port=,port_num-Pport_numCommand-Line Format --port=#System Variable Name portVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 3306Min Value 0Max 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
rootsystem user.-
Command-Line Format --port-open-timeout=#Permitted Values Type integer Default 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 option, see Section 4.2.7, “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.5.8, “Starting MySQL as a Windows Service”. -
Command-Line Format --safe-user-createPermitted Values Type boolean Default FALSEIf this option is enabled, a user cannot create new MySQL users by using the
GRANTstatement unless the user has theINSERTprivilege for themysql.usertable 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. -
Deprecated 5.7.5 Command-Line Format --secure-authSystem Variable Name secure_authVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.4) Type boolean Default ONValid Values OFFONPermitted Values (>= 5.7.5) Type boolean Default ONValid Values ONThis option causes the server to block connections by clients that attempt to use accounts that have passwords stored in the old (pre-4.1) format. Use it to prevent all use of passwords employing the old format (and hence insecure communication over the network).
As of MySQL 5.7.5, this option is deprecated and will be removed in a future MySQL release. It is always enabled and attempting to disable it (
--skip-secure-auth,--secure-auth=0) produces an error. Before MySQL 5.7.5, this option is enabled by default but can be disabled.Server startup fails with an error if this option is enabled and the privilege tables are in pre-4.1 format. See Section B.5.2.4, “Client does not support authentication protocol”.
The mysql client also has a
--secure-authoption, which prevents connections to a server if the server requires a password in old format for the client account.NotePasswords that use the pre-4.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided. Pre-4.1 passwords are deprecated and support for them is removed in MySQL 5.7.5. For account upgrade instructions, see Section 6.5.1.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.
-
Command-Line Format --secure-file-priv=dir_nameSystem Variable Name secure_file_privVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.5) Type string Default emptyValid Values emptydirnamePermitted Values (>= 5.7.6) Type string Default platform specificValid Values emptydirnameNULLThis option sets the
secure_file_privsystem variable, which is used to limit the effect of data import and export operations, such as those performed by theLOAD DATAandSELECT ... INTO OUTFILEstatements and theLOAD_FILE()function. For more information, see the description ofsecure_file_priv. -
Command-Line Format --shared-memory[={0,1}]System Variable Name shared_memoryVariable Scope Global Dynamic Variable No Platform Specific Windows Permitted Values Type boolean Default FALSEEnable shared-memory connections by local clients. This option is available only on Windows.
--shared-memory-base-name=nameCommand-Line Format --shared-memory-base-name=nameSystem Variable Name shared_memory_base_nameVariable Scope Global Dynamic Variable No Platform Specific Windows Permitted Values Type string Default MYSQLThe name of shared memory to use for shared-memory connections. This option is available only on Windows. The default name is
MYSQL. The name is case sensitive.Turn off the ability to select and insert at the same time on
MyISAMtables. (This is to be used only if you think you have found a bug in this feature.) See Section 8.11.3, “Concurrent Inserts”.-
Command-Line Format --skip-event-scheduler--disable-event-schedulerTurns the Event Scheduler
OFF. This is not the same as disabling the Event Scheduler, which requires setting--event-scheduler=DISABLED; see The--event-schedulerOption, for more information. This option causes the server to start without using the privilege system at all, which gives anyone with access to the server unrestricted access to all databases. You can cause a running server to start using the grant tables again by executing mysqladmin flush-privileges or mysqladmin reload command from a system shell, or by issuing a MySQL
FLUSH PRIVILEGESstatement after connecting to the server.This option also causes the server to suppress during its startup sequence the loading of user-defined functions (UDFs), scheduled events, and plugins that were installed with the
INSTALL PLUGINstatement. To cause plugins to be loaded anyway, use the--plugin-loadoption.--skip-grant-tablesalso causes thedisabled_storage_enginessystem variable to have no effect.FLUSH PRIVILEGESmight be executed implicitly by other actions performed after startup. For example, mysql_upgrade flushes the privileges during the upgrade procedure.Disable use of the internal host cache for faster name-to-IP resolution. In this case, the server performs a DNS lookup every time a client connects. See Section 8.12.5.2, “DNS Lookup Optimization and the Host Cache”.
Use of
--skip-host-cacheis similar to setting thehost_cache_sizesystem variable to 0, buthost_cache_sizeis more flexible because it can also be used to resize, enable, or disable the host cache at runtime, not just at server startup.If you start the server with
--skip-host-cache, that does not prevent changes to the value ofhost_cache_size, but such changes have no effect and the cache is not re-enabled even ifhost_cache_sizeis set larger than 0.Disable the
InnoDBstorage engine. In this case, because the default storage engine isInnoDB, the server will not start unless you also use--default-storage-engineand--default-tmp-storage-engineto set the default to some other engine for both permanent andTEMPORARYtables.As of MySQL 5.7.5, the
InnoDBstorage engine can no longer be disabled, and the--skip-innodboption is deprecated and has no effect. Its use results in a warning. This option will be removed in a future MySQL release.Do not resolve host names when checking client connections. Use only IP addresses. If you use this option, all
Hostcolumn values in the grant tables must be IP addresses. See Section 8.12.5.2, “DNS Lookup Optimization and the Host Cache”.Depending on the network configuration of your system and the
Hostvalues for your accounts, clients may need to connect using an explicit--hostoption, such as--host=127.0.0.1or--host=::1.An attempt to connect to the host
127.0.0.1normally resolves to thelocalhostaccount. However, this fails if the server is run with the--skip-name-resolveoption, so make sure that an account exists that can accept a connection. For example, to be able to connect asrootusing--host=127.0.0.1or--host=::1, create these accounts:CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root-password'; CREATE USER 'root'@'::1' IDENTIFIED BY 'root-password';Do not listen for TCP/IP connections at all. All interaction with mysqld must be made using named pipes or shared memory (on Windows) or Unix socket files (on Unix). This option is highly recommended for systems where only local clients are permitted. See Section 8.12.5.2, “DNS Lookup Optimization and the Host Cache”.
-
Deprecated 5.7.16 Command-Line Format --skip-partition--disable-partitionDisables user-defined partitioning. Partitioned tables can be seen using
SHOW TABLESor by querying theINFORMATION_SCHEMA.TABLEStable, but cannot be created or modified, nor can data in such tables be accessed. All partition-specific columns in theINFORMATION_SCHEMA.PARTITIONStable displayNULL.Since
DROP TABLEremoves table definition (.frm) files, this statement works on partitioned tables even when partitioning is disabled using the option. The statement, however, does not remove partition definitions associated with partitioned tables in such cases. For this reason, you should avoid dropping partitioned tables with partitioning disabled, or take action to remove orphaned.parfiles manually (if present).NoteAs of MySQL 5.7.6, partition definition (
.par) files are no longer created. Instead, partition definitions are stored in the internal data dictionary.This option is deprecated in MySQL 5.7.16, and is removed from MySQL 8.0.
Options that begin with
--sslspecify whether to permit clients to connect using SSL and indicate where to find SSL keys and certificates. See Section 6.4.5, “Command Options for Secure Connections”.-
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-pagesPlatform Specific Solaris Permitted Values (Solaris) Type boolean Default FALSEStandard 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-linksPermitted Values Type boolean Default ONEnable 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 DIRECTORYoptions 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 8.12.3.2, “Using Symbolic Links for MyISAM Tables on Unix”.This option has no meaning on Windows.
-
Command-Line Format --skip-show-databaseSystem Variable Name skip_show_databaseVariable Scope Global Dynamic Variable No This option sets the
skip_show_databasesystem variable that controls who is permitted to use theSHOW DATABASESstatement. See Section 5.1.5, “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 28.5, “Debugging and Porting MySQL”.
-
Command-Line Format --slow-query-logSystem Variable Name slow_query_logVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFSpecify the initial slow query log state. With no argument or an argument of 1, the
--slow-query-logoption enables the log. If omitted or given with an argument of 0, the option disables the log. -
Command-Line Format --slow-start-timeout=#Permitted Values (Windows) Type integer Default 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 Name socketVariable Scope Global Dynamic Variable No Permitted Values Type string Default /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 Name sql_modeVariable Scope Global, Session Dynamic Variable Yes Permitted Values (<= 5.7.4) Type set Default NO_ENGINE_SUBSTITUTIONValid Values ALLOW_INVALID_DATESANSI_QUOTESERROR_FOR_DIVISION_BY_ZEROHIGH_NOT_PRECEDENCEIGNORE_SPACENO_AUTO_CREATE_USERNO_AUTO_VALUE_ON_ZERONO_BACKSLASH_ESCAPESNO_DIR_IN_CREATENO_ENGINE_SUBSTITUTIONNO_FIELD_OPTIONSNO_KEY_OPTIONSNO_TABLE_OPTIONSNO_UNSIGNED_SUBTRACTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYPAD_CHAR_TO_FULL_LENGTHPIPES_AS_CONCATREAL_AS_FLOATSTRICT_ALL_TABLESSTRICT_TRANS_TABLESPermitted Values (>= 5.7.5, <= 5.7.6) Type set Default ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ENGINE_SUBSTITUTIONValid Values ALLOW_INVALID_DATESANSI_QUOTESERROR_FOR_DIVISION_BY_ZEROHIGH_NOT_PRECEDENCEIGNORE_SPACENO_AUTO_CREATE_USERNO_AUTO_VALUE_ON_ZERONO_BACKSLASH_ESCAPESNO_DIR_IN_CREATENO_ENGINE_SUBSTITUTIONNO_FIELD_OPTIONSNO_KEY_OPTIONSNO_TABLE_OPTIONSNO_UNSIGNED_SUBTRACTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYPAD_CHAR_TO_FULL_LENGTHPIPES_AS_CONCATREAL_AS_FLOATSTRICT_ALL_TABLESSTRICT_TRANS_TABLESPermitted Values (5.7.7) Type set Default ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTIONValid Values ALLOW_INVALID_DATESANSI_QUOTESERROR_FOR_DIVISION_BY_ZEROHIGH_NOT_PRECEDENCEIGNORE_SPACENO_AUTO_CREATE_USERNO_AUTO_VALUE_ON_ZERONO_BACKSLASH_ESCAPESNO_DIR_IN_CREATENO_ENGINE_SUBSTITUTIONNO_FIELD_OPTIONSNO_KEY_OPTIONSNO_TABLE_OPTIONSNO_UNSIGNED_SUBTRACTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYPAD_CHAR_TO_FULL_LENGTHPIPES_AS_CONCATREAL_AS_FLOATSTRICT_ALL_TABLESSTRICT_TRANS_TABLESPermitted Values (>= 5.7.8) Type set Default ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTIONValid Values ALLOW_INVALID_DATESANSI_QUOTESERROR_FOR_DIVISION_BY_ZEROHIGH_NOT_PRECEDENCEIGNORE_SPACENO_AUTO_CREATE_USERNO_AUTO_VALUE_ON_ZERONO_BACKSLASH_ESCAPESNO_DIR_IN_CREATENO_ENGINE_SUBSTITUTIONNO_FIELD_OPTIONSNO_KEY_OPTIONSNO_TABLE_OPTIONSNO_UNSIGNED_SUBTRACTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYPAD_CHAR_TO_FULL_LENGTHPIPES_AS_CONCATREAL_AS_FLOATSTRICT_ALL_TABLESSTRICT_TRANS_TABLESSet the SQL mode. See Section 5.1.8, “Server SQL Modes”.
NoteMySQL installation programs may configure the SQL mode during the installation process. For example, mysql_install_db creates a default option file named
my.cnfin the base installation directory. This file contains a line that sets the SQL mode; see Section 4.4.2, “mysql_install_db — Initialize MySQL Data Directory”.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 --sysdate-is-nowPermitted Values Type boolean Default FALSESYSDATE()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 an alias forNOW(). For information about the implications for binary logging and replication, see the description forSYSDATE()in Section 12.7, “Date and Time Functions” and forSET TIMESTAMPin Section 5.1.5, “Server System Variables”. --tc-heuristic-recover={COMMIT|ROLLBACK}Command-Line Format --tc-heuristic-recover=namePermitted Values Type enumeration Default COMMITValid Values COMMITROLLBACKThe type of decision to use in the heuristic recovery process. To use this option, two or more storage engines that support XA transactions must be installed.
Prior to MySQL 5.7.8, the server interprets
--tc-heuristic-recoveroption values incorrectly due to an off-by-one error (Bug #70860).-
Deprecated 5.7.18 Command-Line Format --temp-poolPermitted Values Type boolean Default TRUEThis option causes most temporary files created by the server to use a small set of names, rather than a unique name for each new file. This works around a problem in the Linux kernel dealing with creating many new files with different names. With the old behavior, Linux seems to “leak” memory, because it is being allocated to the directory entry cache rather than to the disk cache. This option is ignored except on Linux.
As of MySQL 5.7.18, this option is deprecated and is MySQL 8.0.
-
Command-Line Format --transaction-isolation=namePermitted Values Type enumeration Default REPEATABLE-READValid Values READ-UNCOMMITTEDREAD-COMMITTEDREPEATABLE-READSERIALIZABLESets the default transaction isolation level. The
levelvalue can beREAD-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ, orSERIALIZABLE. See Section 13.3.6, “SET TRANSACTION Syntax”.The default transaction isolation level can also be set at runtime using the
SET TRANSACTIONstatement or by setting thetx_isolationsystem variable. -
Command-Line Format --transaction-read-onlyPermitted Values Type boolean Default 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 thetx_read_onlysystem variable. See Section 13.3.6, “SET TRANSACTION Syntax”. --tmpdir=,dir_name-tdir_nameCommand-Line Format --tmpdir=dir_nameSystem Variable Name tmpdirVariable Scope Global Dynamic Variable No Permitted Values 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. If the MySQL server is acting as a replication slave, you should not set--tmpdirto point to a directory on a memory-based file system or to a directory that is cleared when the server host restarts. For more information about the storage location of temporary files, see Section B.5.3.5, “Where MySQL Stores Temporary Files”. A replication slave needs some of its temporary files to survive a machine restart so that it can replicate temporary tables orLOAD DATA INFILEoperations. If files in the temporary file directory are lost when the server restarts, replication fails.--user={,user_name|user_id}-u {user_name|user_id}Command-Line Format --user=namePermitted Values Type 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 6.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.Use this option with the
--helpoption for detailed help.--version,-VDisplay version information and exit.
--bind-address=0.0.0.0
Option: open-files-limit
It seems that the Debian upstart doesn't use the parameters defined at /etc/security/limits.conf, so when you launch mysql through the service command (and so, under upstart), it overrides those defined limits and uses the default 1024.
The solution is to modify the mysql.conf file that defines the upstart service, it is located at /etc/init/mysql.conf and add the following lines before the pre-start block:
# NB: Upstart scripts do not respect
# /etc/security/limits.conf, so the open-file limits
# settings need to be applied here.
limit nofile 32000 32000
limit nproc 32000 32000
References:
http://serverfault.com/questions/440878/changing-open-files-limit-in-mysql-5-5
http://askubuntu.com/questions/288471/cant-open-files-after-updating-server-what-changed