Table of Contents
MySQL Server (mysqld) is the main program that does most of the work in a MySQL installation. This chapter provides an overview of MySQL Server and covers general server administration:
Server configuration.
The server log files.
Management of multiple servers on a single machine.
For additional information on administrative topics, see also:
mysqld is the MySQL server. The following discussion covers these MySQL server configuration topics:
Startup options that the server supports. You can specify these options on the command line, through configuration files, or both.
Server system variables. These variables reflect the current state and values of the startup options, some of which can be modified while the server is running.
Server status variables. These variables contain counters and statistics about runtime operation.
How to set the server SQL mode. This setting modifies certain aspects of SQL syntax and semantics, for example for compatibility with code from other database systems, or to control the error handling for particular situations.
The server shutdown process. There are performance and reliability considerations depending on the type of table (transactional or nontransactional) and whether you use replication.
For listings of MySQL server variables and options that have been added, deprecated, or removed in MySQL 5.7, see Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 5.7”.
Not all storage engines are supported by all MySQL server binaries and configurations. To find out how to determine which storage engines your MySQL server installation supports, see Section 13.7.5.16, “SHOW ENGINES Syntax”.
The following table provides a list of all the command line
options, server and status variables applicable within
mysqld
.
The table lists command-line options (Cmd-line), options valid in configuration files (Option file), server system variables (System Var), and status variables (Status var) in one unified list, with notification of where each option/variable is valid. If a server option set on the command line or in an option file differs from the name of the corresponding server system or status variable, the variable name is noted immediately below the corresponding option. For status variables, the scope of the variable is shown (Scope) as either global, session, or both. Please see the corresponding sections for details on setting and using the options and variables. Where appropriate, a direct link to further information on the item as available.
For a version of this table that is specific to MySQL Cluster, see Section 18.3.2.5, “MySQL Cluster mysqld Option and Variable Reference”.
Table 5.1 Option/Variable Summary
The MySQL server has many operating parameters, which you can change at server startup using command-line options or configuration files (option files). It is also possible to change many parameters at runtime. For general instructions on setting parameters at startup or runtime, see Section 5.1.3, “Server Command Options”, and Section 5.1.4, “Server System Variables”.
Before MySQL 5.7.5, on Unix platforms,
mysql_install_db creates a default option file
named my.cnf
in the base installation
directory. This file is created from a template included in the
distribution package named my-default.cnf
.
You can find the template in or under the base installation
directory. When started using mysqld_safe, the
server uses my.cnf
file by default. If
my.cnf
already exists,
mysql_install_db assumes it to be in use and
writes a new file named my-new.cnf
instead.
With one exception, the settings in the default option file are
commented and have no effect. The exception is that the file sets
the sql_mode
system variable to
NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
.
This setting produces a server configuration that results in
errors rather than warnings for bad data in operations that modify
transactional tables. See Section 5.1.7, “Server SQL Modes”.
On Windows, MySQL Installer interacts with the user and creates a
file named my.ini
in the base installation
directory as the default option file. If you install on Windows
from a Zip archive, you can copy the
my-default.ini
template file in the base
installation directory to my.ini
and use the
latter as the default option file.
On Windows, the .ini
or
.cnf
option file extension might not be
displayed.
On any platform, after completing the installation process, you
can edit the default option file at any time to modify the
parameters used by the server. For example, to use a parameter
setting in the file that is commented with a #
character at the beginning of the line, remove the
#
, and modify the parameter value if necessary.
To disable a setting, either add a #
to the
beginning of the line or remove it.
For additional information about option file format and syntax, see Section 4.2.6, “Using Option Files”.
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 mysqld --help. To see the full list, use mysqld --verbose --help.
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.3.11.5, “Command Options for Secure Connections”.
Binary log control options: See Section 5.2.4, “The Binary Log”.
Replication-related options: See Section 17.1.6, “Replication and Binary Logging Options and Variables”.
Options for loading plugins such as pluggable storage engines: See Section 5.1.8.1, “Installing and Uninstalling Plugins”.
Options specific to particular storage engines: See Section 14.12, “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
--key_buffer_size=32M
sets the key_buffer_size
variable
to a value of 32MB.
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.
If you want to restrict the maximum value to which a variable can
be set at runtime with
SET
, you
can define this by using the
--maximum-
command-line option.
var_name
=value
You can change the values of most system variables for a running
server with the
SET
statement. See Section 13.7.4, “SET Syntax”.
Section 5.1.4, “Server System Variables”, provides a full description for all variables, and additional information for setting them at server startup and runtime. Section 8.12.2, “Tuning Server Parameters”, includes information on optimizing the server by tuning system variables.
--help
, -?
Command-Line Format | --help |
Display a short help message and exit. Use both the
--verbose
and
--help
options to see the full
message.
Command-Line Format | --allow-suspicious-udfs | ||
Permitted Values | Type | boolean | |
Default | FALSE |
This option controls whether user-defined functions that have
only an xxx
symbol 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 25.4.2.6, “UDF Security Precautions”.
Command-Line Format | --ansi |
Use standard (ANSI) SQL syntax instead of MySQL syntax. For
more precise control over the server SQL mode, use the
--sql-mode
option instead. See
Section 1.8, “MySQL Standards Compliance”, and
Section 5.1.7, “Server SQL Modes”.
--basedir=
,
dir_name
-b
dir_name
Command-Line Format | --basedir=dir_name | ||
System Variable | Name | basedir | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | directory name |
The path to the MySQL installation directory. All paths are usually resolved relative to this directory.
Command-Line Format | --big-tables | ||
System Variable | Name | big_tables | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Enable 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. Since MySQL 3.23.2, 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=addr | ||
System Variable | Name | bind_address | |
Variable 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, where
addr
addr
is an IPv4 or IPv6 address or
a host name. If addr
is 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.1
or
--host=::ffff:127.0.0.1
.
If the address is a “regular” IPv4 or IPv6
address (such as 127.0.0.1
or
::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.user
grant 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 the
mysql.user
table so you can still connect
to the server to shut it down.
--binlog-format={ROW|STATEMENT|MIXED}
Command-Line Format | --binlog-format=format | ||
System Variable | Name | binlog_format | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (<= 5.7.6) | Type | enumeration | |
Default | STATEMENT | ||
Valid Values | ROW | ||
STATEMENT | |||
MIXED | |||
Permitted Values (>= 5.7.7) | Type | enumeration | |
Default | ROW | ||
Valid Values | ROW | ||
STATEMENT | |||
MIXED |
Specify whether to use row-based, statement-based, or mixed replication. Statement-based is the default in MySQL 5.7. See Section 17.2.1, “Replication Formats”.
Under some conditions, changing this variable at runtime is not possible, or causes replication to fail. See Section 5.2.4.2, “Setting The Binary Log Format”, for more information.
Setting the binary logging format without enabling binary
logging sets the
binlog_format
global system
variable and logs a warning.
Deprecated | 5.7.6 | ||
Command-Line Format | --bootstrap |
This option is used by the mysql_install_db program to create the MySQL privilege tables without having to start a full MySQL server.
mysql_install_db is deprecated as of
MySQL 5.7.6 because its functionality has been integrated
into mysqld, the MySQL server.
Consequently, the --bootstrap
server option that mysql_install_db
passes to mysqld is also deprecated. To
initialize a MySQL installation as of MySQL 5.7.6, invoke
mysqld with the
--initialize
or
--initialize-insecure
option.
For more information, see
Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.
mysql_install_db and the
--bootstrap
server option
will be removed in a future MySQL release.
--bootstrap
is mutually
exclusive with --daemonize
,
--initialize
, and
--initialize-insecure
.
In MySQL 5.7.8 and later global transaction identifiers
(GTIDs) are not disabled when
--bootstrap
is used. Before
MySQL 5.7.8, GTIDs were automatically disabled whenever
--bootstrap
was used (Bug
#20980271). See Section 17.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-file
option. For
more information, see the description of that option. In
addition, the
disabled_storage_engines
system variable has no effect.
Command-Line Format | --character-sets-dir=dir_name | ||
System Variable | Name | character_sets_dir | |
Variable 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-handshake
Command-Line Format | --character-set-client-handshake | ||
Permitted Values | Type | boolean | |
Default | TRUE |
Do 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_name
Command-Line Format | --character-set-filesystem=name | ||
System Variable | Name | character_set_filesystem | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | binary |
The file system character set. This option sets the
character_set_filesystem
system variable.
--character-set-server=
,
charset_name
-C
charset_name
Command-Line Format | --character-set-server | ||
System Variable | Name | character_set_server | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | latin1 |
Use charset_name
as 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-server
to
specify the collation.
--chroot=
,
dir_name
-r
dir_name
Command-Line Format | --chroot=dir_name | ||
Permitted 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 limits
LOAD DATA
INFILE
and
SELECT ... INTO
OUTFILE
.
--collation-server=
collation_name
Command-Line Format | --collation-server | ||
System Variable | Name | collation_server | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | latin1_swedish_ci |
Use collation_name
as the default
server collation. See Section 10.5, “Character Set Configuration”.
Command-Line Format | --console | ||
Platform Specific | Windows |
(Windows only.) Write error log messages to
stderr
and stdout
even
if --log-error
is specified.
mysqld does not close the console window if
this option is used.
If both --log-error
and
--console
are specified,
--console
takes 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-error
causes
--console
to be ignored.)
Command-Line Format | --core-file | ||
Permitted Values | Type | boolean | |
Default | OFF |
Write 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.
pid
pid
represents the process ID of
the server process. On OS X, a core file named
core.
is
written to the pid
/cores
directory. 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-size
option 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
--user
option. 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 | OFF |
This 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”.
--daemonize
is mutually
exclusive with --bootstrap
,
--initialize
, and
--initialize-insecure
.
--datadir=
,
dir_name
-h
dir_name
Command-Line Format | --datadir=dir_name | ||
System Variable | Name | datadir | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | directory name |
The path to the data directory.
--debug[=
,
debug_options
]-# [
debug_options
]
Command-Line Format | --debug[=debug_options] | ||
System Variable | Name | debug | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (Unix) | Type | string | |
Default | d:t:i:o,/tmp/mysqld.trace | ||
Permitted Values (Windows) | Type | string | |
Default | d:t:i:O,\mysqld.trace |
If MySQL is configured with the
-DWITH_DEBUG=1
CMake option, you can use this option to
get a trace file of what mysqld is doing. A
typical debug_options
string is
d:t:o,
.
The default is file_name
d:t:i:o,/tmp/mysqld.trace
on
Unix and d:t:i:O,\mysqld.trace
on Windows.
Using -DWITH_DEBUG=1
to
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=+P
sets the value to
P:T
.
For more information, see Section 25.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=1
CMake 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_name
Removed | 5.7.2 | ||
Command-Line Format | --default-authentication-plugin=plugin_name | ||
Permitted Values | Type | enumeration | |
Default | mysql_native_password | ||
Valid Values | mysql_native_password | ||
sha256_password |
This option sets the default authentication plugin. It was
removed in MySQL 5.7.2 and replaced by the
default_authentication_plugin
system 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 of
default_authentication_plugin
.
Command-Line Format | --default-storage-engine=name | ||
System Variable | Name | default_storage_engine | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | InnoDB |
Set 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 TEMPORARY
tables, set the
default_tmp_storage_engine
system variable.
If you disable the default storage engine at server startup,
you must set the default engine for both permanent and
TEMPORARY
tables to a different engine or
the server will not start.
Command-Line Format | --default-time-zone=name | ||
Permitted Values | Type | string |
Set the default server time zone. This option sets the global
time_zone
system variable. If
this option is not given, the default time zone is the same as
the system time zone (given by the value of the
system_time_zone
system
variable.
--defaults-extra-file=
file_name
Read 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_name
is interpreted relative
to the current directory if given as a relative path name
rather than a full path name.
Use only the given option file. If the file does not exist or
is otherwise inaccessible, an error occurs.
file_name
is interpreted relative
to the current directory if given as a relative path name
rather than a full path name.
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=_other
option is given, mysqld also reads the
[mysqld_other]
group.
--delay-key-write[={OFF|ON|ALL}]
Command-Line Format | --delay-key-write[=name] | ||
System Variable | Name | delay_key_write | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | ON | ||
Valid Values | ON | ||
OFF | |||
ALL |
Specify how to use delayed key writes. Delayed key writing
causes key buffers not to be flushed between writes for
MyISAM
tables. OFF
disables delayed key writes. ON
enables
delayed key writes for those tables that were created with the
DELAY_KEY_WRITE
option.
ALL
delays key writes for all
MyISAM
tables. See
Section 8.12.2, “Tuning Server Parameters”, and
Section 15.2.1, “MyISAM Startup Options”.
If you set this variable to ALL
, you
should not use MyISAM
tables 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_name |
Read the default DES keys from this file. These keys are used
by the DES_ENCRYPT()
and
DES_DECRYPT()
functions.
--early-plugin-load=
plugin_list
Introduced | 5.7.11 | ||
Command-Line Format | --early-plugin-load=plugin_list | ||
Permitted Values (5.7.11) | Type | string | |
Default | keyring_file plugin library file name | ||
Permitted Values (>= 5.7.12) | Type | string | |
Default | empty string |
This option tells the server which plugins to load before
loading mandatory built-in plugins and before storage engine
initialization. The option value is a semicolon-separated list
of
name
=
plugin_library
and plugin_library
values. Each
name
is the name of a plugin to
load, and plugin_library
is the
name of the library object 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 the
plugin_dir
system variable.
For example, if plugins named myplug1
and
myplug2
have library files
myplug1.so
and
myplug2.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 a semicolon
(;
) is interpreted as a special character
by some command interpreters. (Unix shells treat it as a
command terminator, for example.)
If multiple --early-plugin-load
options are given, only the last one is used.
Each plugin is loaded early for a single invocation of
mysqld only. After a restart, the plugin is
not loaded early unless
--early-plugin-load
is used
again.
If the server is started using
--initialize
or
--initialize-insecure
, plugins
specified by
--early-plugin-load
are not
loaded.
If the server is run with
--help
, plugins specified by
--early-plugin-load
are 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-load
value is
empty. To load the keyring_file
plugin, you
must use an explicit
--early-plugin-load
option with
a nonempty value.
In MySQL 5.7.11, the default
--early-plugin-load
value was
the name of the keyring_file
plugin
library file, so that plugin was loaded by default.
InnoDB
tablespace encryption requires the
keyring_file
plugin to be loaded prior to
InnoDB
initialization, so this change of
default value introduces an incompatibility for upgrades
from 5.7.11 to 5.7.12 or higher. Administrators who have
encrypted InnoDB
tablespaces must take
explicit action to ensure continued loading of the
keyring_file
plugin: Start the server
with an --early-plugin-load
option that names the plugin library file. For additional
information, see Section 6.4.3, “The MySQL Keyring”.
The InnoDB
tablespace encryption feature
relies on the keyring_file
plugin for
encryption key management, and the
keyring_file
plugin must be loaded prior to
storage engine initialization to facilitate
InnoDB
recovery for encrypted tables. In
MySQL 5.7.11, if you do not want to load the
keyring_file
plugin at server startup,
specify an empty string
(--early-plugin-load=""
).
For information about InnoDB
tablespace
encryption, see
Section 14.5.10, “InnoDB Tablespace Encryption”. For general
information about plugin loading, see
Section 5.1.8.1, “Installing and Uninstalling Plugins”.
Command-Line Format | --enable-named-pipe | ||
Platform Specific | Windows |
Enable support for named pipes. This option applies only on Windows.
Command-Line Format | --event-scheduler[=value] | ||
System Variable | Name | event_scheduler | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | OFF | ||
Valid Values | ON | ||
OFF | |||
DISABLED |
Enable or disable, and start or stop, the event scheduler.
For detailed information, see
The
--event-scheduler
Option.
--exit-info[=
,
flags
]-T [
flags
]
Command-Line Format | --exit-info[=flags] | ||
Permitted Values | Type | integer |
This is a bit mask 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 | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Enable external locking (system locking), which is disabled by
default. If you use this option on a system on which
lockd
does 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
MyISAM
table access. For more
information, including conditions under which it can and
cannot be used, see Section 8.11.5, “External Locking”.
Command-Line Format | --flush | ||
System Variable | Name | flush | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Flush (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 | --gdb | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Install an interrupt handler for SIGINT
(needed to stop mysqld with
^C
to set breakpoints) and disable stack
tracing and core file handling. See Section 25.5, “Debugging and Porting MySQL”.
Command-Line Format | --general-log | ||
System Variable | Name | general_log | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Specify the initial general query log state. With no argument
or an argument of 1, the
--general-log
option enables
the log. If omitted or given with an argument of 0, the option
disables the log.
Command-Line Format | --ignore-db-dir | ||
Permitted Values | Type | directory name |
This option tells the server to ignore the given directory
name for purposes of the SHOW
DATABASES
statement or
INFORMATION_SCHEMA
tables. For example, if
a MySQL configuration locates the data directory at the root
of a file system on Unix, the system might create a
lost+found
directory there that the
server should ignore. Starting the server with
--ignore-db-dir=lost+found
causes 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_dirs
system
variable.
Introduced | 5.7.6 | ||
Command-Line Format | --initialize | ||
Permitted Values | Type | boolean | |
Default | OFF |
This option is used to initialize a MySQL installation by
creating the data directory and populating the tables in the
mysql
system 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-file
option. For more information, see
the description of that option. In addition, the
disabled_storage_engines
system variable has no effect.
In MySQL 5.7.7 and earlier, global transaction identifiers
(GTIDs) were automatically disabled whenever
--initialize
was enabled. In
MySQL 5.7.8 and later GTIDs are not disabled when
--initialize
is enabled.
--initialize
is mutually
exclusive with --bootstrap
and
--daemonize
.
Introduced | 5.7.6 | ||
Command-Line Format | --initialize-insecure | ||
Permitted Values | Type | boolean | |
Default | OFF |
This option is used to initialize a MySQL installation by
creating the data directory and populating the tables in the
mysql
system 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-insecure
is
mutually exclusive with
--bootstrap
and
--daemonize
.
Command-Line Format | --init-file=file_name | ||
System Variable | Name | init_file | |
Variable 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-insecure
options,
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 as CREATE USER
or
GRANT
), replication, and global
transaction identifiers. See
Section 17.1.3, “Replication with Global Transaction Identifiers”.
--innodb-
xxx
Set an option for the InnoDB
storage
engine. The InnoDB
options are listed in
Section 14.12, “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 MySQL
if no
service_name
value is given. For
more information, see Section 2.3.5.8, “Starting MySQL as a Windows Service”.
If the server is started with the
--defaults-file
and
--install
options,
--install
must 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
MySQL
if no
service_name
value is given. For
more information, see Section 2.3.5.8, “Starting MySQL as a Windows Service”.
If the server is started with the
--defaults-file
and
--install-manual
options,
--install-manual
must be
first.
--language=
lang_name
,
-L lang_name
Deprecated | 5.6.1, by lc-messages-dir | ||
Command-Line Format | --language=name | ||
System Variable | Name | language | |
Variable 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_name
can 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-dir
and
--lc-messages
should be used
rather than --language
, which
is deprecated (and handled as an alias for
--lc-messages-dir
). The
--language
option will be
removed in a future MySQL release.
Command-Line Format | --large-pages | ||
System Variable | Name | large_pages | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Platform Specific | Linux | ||
Permitted Values (Linux) | Type | boolean | |
Default | FALSE |
Some 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.5.2, “Enabling Large Page Support”. For Solaris support of
large pages, see the description of the
--super-large-pages
option.
--large-pages
is disabled by
default.
Command-Line Format | --lc-messages=name | ||
System Variable | Name | lc_messages | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | en_US |
The 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-dir
to produce
the location for the error message file. See
Section 10.2, “Setting the Error Message Language”.
Command-Line Format | --lc-messages-dir=dir_name | ||
System Variable | Name | lc_messages_dir | |
Variable 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-messages
to 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-service
option
following the service name causes the server to run using the
LocalService
Windows account that has
limited system privileges. This account is available only for
Windows XP or newer. If both
--defaults-file
and
--local-service
are 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_error | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | file name |
Log errors and startup messages to this file. See
Section 5.2.2, “The Error Log”. If you omit the file name, MySQL
uses
.
If the file name has no extension, the server adds an
extension of host_name
.err.err
.
Command-Line Format | --log-isam[=file_name] | ||
Permitted Values | Type | file name |
Log all MyISAM
changes to this file (used
only when debugging MyISAM
).
Command-Line Format | --log-output=name | ||
System Variable | Name | log_output | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | set | |
Default | FILE | ||
Valid Values | TABLE | ||
FILE | |||
NONE |
This 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
, or NONE
.
TABLE
select logging to the
general_log
and
slow_log
tables in the
mysql
database as a destination.
FILE
selects logging to log files as a
destination. NONE
disables logging. If
NONE
is present in the option value, it
takes precedence over any other words that are present.
TABLE
and FILE
can 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_log
and
--slow_query_log
options. For
FILE
logging, the
--general_log_file
and
-slow_query_log_file
options determine the
log file location. For more information, see
Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”.
--log-queries-not-using-indexes
Command-Line Format | --log-queries-not-using-indexes | ||
System Variable | Name | log_queries_not_using_indexes | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
If you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section 5.2.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 | OFF |
Passwords 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-raw
option. 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-raw
option affects
statement logging as follows:
For more information, see Section 6.1.2.3, “Passwords and Logging”.
Command-Line Format | --log-short-format | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Log 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 | OFF |
Include 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
, and
REPAIR TABLE
.
This command-line option was removed in MySQL 5.7.1 and
replaced by the
log_slow_admin_statements
system 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_name | ||
Permitted Values | Type | file name | |
Default | tc.log |
The 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 | 24576 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 24576 | ||
Max Value | 18446744073709551615 |
The 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_warnings | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms, <= 5.7.1) | Type | integer | |
Default | 1 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (32-bit platforms, >= 5.7.2) | Type | integer | |
Default | 2 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms, <= 5.7.1) | Type | integer | |
Default | 1 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 | ||
Permitted Values (64-bit platforms, >= 5.7.2) | Type | integer | |
Default | 2 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 |
As of MySQL 5.7.2, the
log_error_verbosity
system
variable is preferred over, and should be used instead of,
the --log-warnings
option or
log_warnings
system
variable. For more information, see the descriptions of
log_error_verbosity
and
log_warnings
. The
--log-warnings
command-line
option and log_warnings
system 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 a level
value
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-updates | ||
System Variable | Name | low_priority_updates | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Give 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 by SET
LOW_PRIORITY_UPDATES=1
to 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=
number
Command-Line Format | --min-examined-row-limit=# | ||
System Variable | Name | min_examined_row_limit | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 |
When this option is set, queries which examine fewer than
number
rows are not written to the
slow query log. The default is 0.
Command-Line Format | --memlock | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Lock 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.
--memlock
works on systems that
support the mlockall()
system call; this
includes Solaris, most Linux distributions that use a 2.4 or
newer kernel, and perhaps other Unix systems. On Linux
systems, you can tell whether or not
mlockall()
(and thus this option) is
supported by checking to see whether or not it is defined in
the system mman.h
file, like this:
shell> grep mlockall /usr/include/sys/mman.h
If mlockall()
is supported, you should see
in the output of the previous command something like the
following:
extern int mlockall (int __flags) __THROW;
Use 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 root
by changing the
limits.conf
file. See the notes
regarding the memlock limit in
Section 8.12.5.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 | 1024 | ||
Min Value | 1024 | ||
Max Value | 16384 |
The block size to be used for MyISAM
index
pages.
--myisam-recover-options[=
option
[,option
]...]]
Command-Line Format | --myisam-recover-options[=name] | ||
Permitted Values | Type | enumeration | |
Default | OFF | ||
Valid Values | OFF | ||
DEFAULT | |||
BACKUP | |||
FORCE | |||
QUICK |
Set the MyISAM
storage engine recovery
mode. The option value is any combination of the values of
OFF
, DEFAULT
,
BACKUP
, FORCE
, or
QUICK
. If you specify multiple values,
separate them by commas. Specifying the option with no
argument is the same as specifying DEFAULT
,
and specifying with an explicit value of ""
disables recovery (same as a value of OFF
).
If recovery is enabled, each time mysqld
opens a MyISAM
table, 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 |
---|---|
OFF | No recovery. |
DEFAULT | Recovery without backup, forcing, or quick checking. |
BACKUP | If the data file was changed during recovery, save a backup of the
file as
. |
FORCE | Run recovery even if we would lose more than one row from the
.MYD file. |
QUICK | Do 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-defaults
can be used to
prevent them from being read.
The exception is that the .mylogin.cnf
file, if it exists, is read in all cases. This permits
passwords to be specified in a safer way than on the command
line even when --no-defaults
is
used. (.mylogin.cnf
is created by the
mysql_config_editor utility. See
Section 4.6.6, “mysql_config_editor — MySQL Configuration Utility”.)
Command-Line Format | --old-alter-table | ||
System Variable | Name | old_alter_table | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
When this option is given, the server does not use the
optimized method of processing an ALTER
TABLE
operation. 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 of
ALTER TABLE
, see
Section 13.1.8, “ALTER TABLE Syntax”.
Command-Line Format | --old-style-user-limits | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Enable 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
user
table.) See
Section 6.3.4, “Setting Account Resource Limits”.
Command-Line Format | --open-files-limit=# | ||
System Variable | Name | open_files_limit | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | 5000, with possible adjustment | ||
Min Value | 0 | ||
Max Value | platform dependent |
Changes 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 with setrlimit()
. 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_connections
and
table_open_cache
to estimate
whether more descriptors will be needed.
On Unix, the value cannot be set less than ulimit -n.
Command-Line Format | --partition | ||
Disabled by | skip-partition | ||
Permitted Values | Type | boolean | |
Default | ON |
Enables or disables user-defined partitioning support in the MySQL Server.
--performance-schema-xxx
Configure a Performance Schema option. For details, see Section 22.11, “Performance Schema Command Options”.
Command-Line Format | --pid-file=file_name | ||
System Variable | Name | pid_file | |
Variable 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.
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
--plugin
prefix. Thus, the
--innodb_file_per_table
option
for InnoDB
can be specified as
--plugin-innodb_file_per_table
.
For boolean options that can be enabled or disabled, the
--skip
prefix and other alternative formats
are supported as well (see
Section 4.2.5, “Program Option Modifiers”). For example,
--skip-plugin-innodb_file_per_table
disables innodb_file_per_table
.
The rationale for the --plugin
prefix 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
--plugin
prefix for plugin options is
recommended to avoid any question of ambiguity.
Command-Line Format | --plugin-load=plugin_list | ||
Permitted Values | Type | string |
This option tells the server to load the named plugins at
startup. The option value is a semicolon-separated list of
name
=
plugin_library
and plugin_library
values. Each
name
is the name of a plugin to
load, and plugin_library
is the
name of the library object 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 the
plugin_dir
system variable.
For example, if plugins named myplug1
and
myplug2
have library files
myplug1.so
and
myplug2.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
semicolon (;
) is interpreted as a special
character by some command interpreters. (Unix shells treat it
as a command terminator, for example.)
If multiple --plugin-load
options are given, only the last one is used. Additional
plugins to load may be specified using
--plugin-load-add
options.
Each plugin is loaded for a single invocation of
mysqld only. After a restart, the plugin is
not loaded unless --plugin-load
is used again. This is in contrast to
INSTALL PLUGIN
, which adds an
entry to the mysql.plugins
table 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.plugins
system
table. If the server is started with the
--skip-grant-tables
option, it
does not consult the mysql.plugins
table
and does not load plugins listed there.
--plugin-load
enables plugins
to be loaded even when
--skip-grant-tables
is given.
--plugin-load
also enables
plugins to be loaded at startup that cannot be loaded at
runtime.
For additional information about plugin loading, see Section 5.1.8.1, “Installing and Uninstalling Plugins”.
Command-Line Format | --plugin-load-add=plugin_list | ||
Permitted Values | Type | string |
This option complements the
--plugin-load
option.
--plugin-load-add
adds 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-add
can be used
to avoid specifying a large set of plugins as a single long
unwieldy --plugin-load
argument.
--plugin-load-add
can be given
in the absence of
--plugin-load
, but any instance
of --plugin-load-add
that
appears before --plugin-load
.
has no effect because
--plugin-load
resets the set of
plugins to load. In other words, these options:
--plugin-load=x --plugin-load-add=y
are equivalent to this option:
--plugin-load="x;y"
But these options:
--plugin-load-add=y --plugin-load=x
are equivalent to this option:
--plugin-load=x
For additional information about plugin loading, see Section 5.1.8.1, “Installing and Uninstalling Plugins”.
--port=
,
port_num
-P
port_num
Command-Line Format | --port=# | ||
System Variable | Name | port | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | 3306 | ||
Min Value | 0 | ||
Max Value | 65535 |
The 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
root
system user.
Command-Line Format | --port-open-timeout=# | ||
Permitted Values | Type | integer | |
Default | 0 |
On 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.
Command-Line Format | --remove [service_name] | ||
Platform Specific | Windows |
(Windows only) Remove a MySQL Windows service. The default
service name is MySQL
if no
service_name
value is given. For
more information, see Section 2.3.5.8, “Starting MySQL as a Windows Service”.
Command-Line Format | --safe-user-create | ||
Permitted Values | Type | boolean | |
Default | FALSE |
If this option is enabled, a user cannot create new MySQL
users by using the GRANT
statement unless the user has the
INSERT
privilege for the
mysql.user
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
GRANT
statement to give
privileges to other users.
Deprecated | 5.7.5 | ||
Command-Line Format | --secure-auth | ||
System Variable | Name | secure_auth | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (<= 5.7.4) | Type | boolean | |
Default | ON | ||
Valid Values | OFF | ||
ON | |||
Permitted Values (>= 5.7.5) | Type | boolean | |
Default | ON | ||
Valid Values | ON |
This 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-auth
option, which
prevents connections to a server if the server requires a
password in old format for the client account.
Passwords 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.4.1.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.
Command-Line Format | --secure-file-priv=dir_name | ||
System Variable | Name | secure_file_priv | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values (<= 5.7.5) | Type | string | |
Default | empty | ||
Valid Values | empty | ||
dirname | |||
Permitted Values (>= 5.7.6) | Type | string | |
Default | platform specific | ||
Valid Values | empty | ||
dirname | |||
NULL |
This option sets the
secure_file_priv
system
variable, which is used to limit the effect of data import and
export operations, such as those performed by the
LOAD DATA
and
SELECT ... INTO
OUTFILE
statements and the
LOAD_FILE()
function. For more
information, see the description of
secure_file_priv
.
Command-Line Format | --shared_memory[={0,1}] | ||
System Variable | Name | shared_memory | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Platform Specific | Windows | ||
Permitted Values | Type | boolean | |
Default | FALSE |
Enable shared-memory connections by local clients. This option is available only on Windows.
--shared-memory-base-name=
name
Command-Line Format | --shared_memory_base_name=name | ||
System Variable | Name | shared_memory_base_name | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Platform Specific | Windows | ||
Permitted Values | Type | string | |
Default | MYSQL |
The 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
MyISAM
tables. (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-scheduler |
Turns the Event Scheduler OFF
. This is not
the same as disabling the Event Scheduler, which requires
setting
--event-scheduler=DISABLED
; see
The
--event-scheduler
Option, 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
PRIVILEGES
statement after connecting to the server.
This option also suppresses loading of user-defined functions
(UDFs), scheduled events, and plugins that were installed with
the INSTALL PLUGIN
statement.
To cause plugins to be loaded anyway, use the
--plugin-load
option.
--skip-grant-tables
also causes
the disabled_storage_engines
system variable to have no effect.
FLUSH
PRIVILEGES
might 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.6.2, “DNS Lookup Optimization and the Host Cache”.
Use of --skip-host-cache
is
similar to setting the
host_cache_size
system
variable to 0, but
host_cache_size
is 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 of
host_cache_size
, but such
changes have no effect and the cache is not re-enabled even if
host_cache_size
is set larger
than 0.
Disable the InnoDB
storage engine. In this
case, because the default storage engine is
InnoDB
, the server will not start
unless you also use
--default-storage-engine
and
--default-tmp-storage-engine
to
set the default to some other engine for both permanent and
TEMPORARY
tables.
As of MySQL 5.7.5, the InnoDB
storage
engine can no longer be disabled, and the
--skip-innodb
option 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
Host
column values in the grant tables must
be IP addresses. See Section 8.12.6.2, “DNS Lookup Optimization and the Host Cache”.
Depending on the network configuration of your system and the
Host
values for your accounts, clients may
need to connect using an explicit --host
option, such as --host=127.0.0.1
or
--host=::1
.
An attempt to connect to the host 127.0.0.1
normally resolves to the localhost
account.
However, this fails if the server is run with the
--skip-name-resolve
option, so
make sure that an account exists that can accept a connection.
For example, to be able to connect as root
using --host=127.0.0.1
or
--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.6.2, “DNS Lookup Optimization and the Host Cache”.
Command-Line Format | --skip-partition | ||
--disable-partition |
Disables user-defined partitioning. Partitioned tables can be
seen using SHOW TABLES
or by
querying the
INFORMATION_SCHEMA.TABLES
table,
but cannot be created or modified, nor can data in such tables
be accessed. All partition-specific columns in the
INFORMATION_SCHEMA.PARTITIONS
table display NULL
.
Since DROP TABLE
removes 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 .par
files manually
(if present).
As of MySQL 5.7.6, partition definition
(.par
) files are no longer created.
Instead, partition definitions are stored in the internal
data dictionary.
Options that begin with --ssl
specify whether to permit clients to connect using SSL and
indicate where to find SSL keys and certificates. See
Section 6.3.11.5, “Command Options for Secure Connections”.
Command-Line Format | --standalone | ||
Platform Specific | Windows |
Available on Windows only; instructs the MySQL server not to run as a service.
Command-Line Format | --super-large-pages | ||
Platform Specific | Solaris | ||
Permitted Values (Solaris) | Type | boolean | |
Default | FALSE |
Standard 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-pages
or
--skip-super-large-pages
option.
--symbolic-links
,
--skip-symbolic-links
Command-Line Format | --symbolic-links |
Enable or disable symbolic link support. On Unix, enabling
symbolic links means that you can link a
MyISAM
index file or data file to another
directory with the INDEX DIRECTORY
or
DATA DIRECTORY
options of the
CREATE TABLE
statement. If you
delete or rename the table, the files that its symbolic links
point to also are deleted or renamed. See
Section 8.12.4.2, “Using Symbolic Links for MyISAM Tables on Unix”.
This option has no meaning on Windows.
Command-Line Format | --skip-show-database | ||
System Variable | Name | skip_show_database | |
Variable Scope | Global | ||
Dynamic Variable | No |
This option sets the
skip_show_database
system
variable that controls who is permitted to use the
SHOW DATABASES
statement. See
Section 5.1.4, “Server System Variables”.
Command-Line Format | --skip-stack-trace |
Do 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 25.5, “Debugging and Porting MySQL”.
Command-Line Format | --slow-query-log | ||
System Variable | Name | slow_query_log | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Specify the initial slow query log state. With no argument or
an argument of 1, the
--slow-query-log
option 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 | 15000 |
This 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 | socket | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string | |
Default | /tmp/mysql.sock |
On 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 is MySQL
(not case
sensitive).
--sql-mode=
value
[,value
[,value
...]]
Command-Line Format | --sql-mode=name | ||
System Variable | Name | sql_mode | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (<= 5.7.4) | Type | set | |
Default | NO_ENGINE_SUBSTITUTION | ||
Valid Values | ALLOW_INVALID_DATES | ||
ANSI_QUOTES | |||
ERROR_FOR_DIVISION_BY_ZERO | |||
HIGH_NOT_PRECEDENCE | |||
IGNORE_SPACE | |||
NO_AUTO_CREATE_USER | |||
NO_AUTO_VALUE_ON_ZERO | |||
NO_BACKSLASH_ESCAPES | |||
NO_DIR_IN_CREATE | |||
NO_ENGINE_SUBSTITUTION | |||
NO_FIELD_OPTIONS | |||
NO_KEY_OPTIONS | |||
NO_TABLE_OPTIONS | |||
NO_UNSIGNED_SUBTRACTION | |||
NO_ZERO_DATE | |||
NO_ZERO_IN_DATE | |||
ONLY_FULL_GROUP_BY | |||
PAD_CHAR_TO_FULL_LENGTH | |||
PIPES_AS_CONCAT | |||
REAL_AS_FLOAT | |||
STRICT_ALL_TABLES | |||
STRICT_TRANS_TABLES | |||
Permitted Values (>= 5.7.5, <= 5.7.6) | Type | set | |
Default | ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ENGINE_SUBSTITUTION | ||
Valid Values | ALLOW_INVALID_DATES | ||
ANSI_QUOTES | |||
ERROR_FOR_DIVISION_BY_ZERO | |||
HIGH_NOT_PRECEDENCE | |||
IGNORE_SPACE | |||
NO_AUTO_CREATE_USER | |||
NO_AUTO_VALUE_ON_ZERO | |||
NO_BACKSLASH_ESCAPES | |||
NO_DIR_IN_CREATE | |||
NO_ENGINE_SUBSTITUTION | |||
NO_FIELD_OPTIONS | |||
NO_KEY_OPTIONS | |||
NO_TABLE_OPTIONS | |||
NO_UNSIGNED_SUBTRACTION | |||
NO_ZERO_DATE | |||
NO_ZERO_IN_DATE | |||
ONLY_FULL_GROUP_BY | |||
PAD_CHAR_TO_FULL_LENGTH | |||
PIPES_AS_CONCAT | |||
REAL_AS_FLOAT | |||
STRICT_ALL_TABLES | |||
STRICT_TRANS_TABLES | |||
Permitted Values (5.7.7) | Type | set | |
Default | ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION | ||
Valid Values | ALLOW_INVALID_DATES | ||
ANSI_QUOTES | |||
ERROR_FOR_DIVISION_BY_ZERO | |||
HIGH_NOT_PRECEDENCE | |||
IGNORE_SPACE | |||
NO_AUTO_CREATE_USER | |||
NO_AUTO_VALUE_ON_ZERO | |||
NO_BACKSLASH_ESCAPES | |||
NO_DIR_IN_CREATE | |||
NO_ENGINE_SUBSTITUTION | |||
NO_FIELD_OPTIONS | |||
NO_KEY_OPTIONS | |||
NO_TABLE_OPTIONS | |||
NO_UNSIGNED_SUBTRACTION | |||
NO_ZERO_DATE | |||
NO_ZERO_IN_DATE | |||
ONLY_FULL_GROUP_BY | |||
PAD_CHAR_TO_FULL_LENGTH | |||
PIPES_AS_CONCAT | |||
REAL_AS_FLOAT | |||
STRICT_ALL_TABLES | |||
STRICT_TRANS_TABLES | |||
Permitted 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_SUBSTITUTION | ||
Valid Values | ALLOW_INVALID_DATES | ||
ANSI_QUOTES | |||
ERROR_FOR_DIVISION_BY_ZERO | |||
HIGH_NOT_PRECEDENCE | |||
IGNORE_SPACE | |||
NO_AUTO_CREATE_USER | |||
NO_AUTO_VALUE_ON_ZERO | |||
NO_BACKSLASH_ESCAPES | |||
NO_DIR_IN_CREATE | |||
NO_ENGINE_SUBSTITUTION | |||
NO_FIELD_OPTIONS | |||
NO_KEY_OPTIONS | |||
NO_TABLE_OPTIONS | |||
NO_UNSIGNED_SUBTRACTION | |||
NO_ZERO_DATE | |||
NO_ZERO_IN_DATE | |||
ONLY_FULL_GROUP_BY | |||
PAD_CHAR_TO_FULL_LENGTH | |||
PIPES_AS_CONCAT | |||
REAL_AS_FLOAT | |||
STRICT_ALL_TABLES | |||
STRICT_TRANS_TABLES |
Set the SQL mode. See Section 5.1.7, “Server SQL Modes”.
MySQL installation programs may configure the SQL mode
during the installation process. For example,
mysql_install_db creates a default option
file named my.cnf
in 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-now | ||
Permitted Values | Type | boolean | |
Default | FALSE |
SYSDATE()
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 of NOW()
.
This option causes SYSDATE()
to
be an alias for NOW()
. For
information about the implications for binary logging and
replication, see the description for
SYSDATE()
in
Section 12.7, “Date and Time Functions” and for SET
TIMESTAMP
in
Section 5.1.4, “Server System Variables”.
--tc-heuristic-recover={COMMIT|ROLLBACK}
Command-Line Format | --tc-heuristic-recover=name | ||
Permitted Values | Type | enumeration | |
Default | COMMIT | ||
Valid Values | COMMIT | ||
ROLLBACK |
The type of decision to use in the heuristic recovery process. This option is unused.
Command-Line Format | --temp-pool | ||
Permitted Values | Type | boolean | |
Default | TRUE |
This 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.
Command-Line Format | --transaction-isolation=name | ||
Permitted Values | Type | enumeration | |
Default | REPEATABLE-READ | ||
Valid Values | READ-UNCOMMITTED | ||
READ-COMMITTED | |||
REPEATABLE-READ | |||
SERIALIZABLE |
Sets the default transaction isolation level. The
level
value can be
READ-UNCOMMITTED
,
READ-COMMITTED
,
REPEATABLE-READ
, or
SERIALIZABLE
. See
Section 13.3.6, “SET TRANSACTION Syntax”.
The default transaction isolation level can also be set at
runtime using the SET
TRANSACTION
statement or by setting the
tx_isolation
system variable.
Command-Line Format | --transaction-read-only | ||
Permitted Values | Type | boolean | |
Default | OFF |
Sets 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 TRANSACTION
statement or
set the tx_read_only
system
variable. See Section 13.3.6, “SET TRANSACTION Syntax”.
--tmpdir=
,
dir_name
-t
dir_name
Command-Line Format | --tmpdir=dir_name | ||
System Variable | Name | tmpdir | |
Variable 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 /tmp
directory 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
--tmpdir
to 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 or
LOAD DATA
INFILE
operations. 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=name | ||
Permitted Values | Type | string |
Run the mysqld server as the user having
the name user_name
or the numeric
user ID user_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 as
root
. See
Section 6.1.1, “Security Guidelines”.
To avoid a possible security hole where a user adds a
--user=root
option to a
my.cnf
file (thus causing the server to
run as root
), mysqld
uses only the first --user
option specified and produces a warning if there are multiple
--user
options. Options in
/etc/my.cnf
and
$MYSQL_HOME/my.cnf
are processed before
command-line options, so it is recommended that you put a
--user
option in
/etc/my.cnf
and specify a value other
than root
. The option in
/etc/my.cnf
is found before any other
--user
options, which ensures
that the server runs as a user other than
root
, and that a warning results if any
other --user
option is found.
Use this option with the --help
option for detailed help.
--version
, -V
Display version information and exit.
The MySQL server maintains many system variables that indicate how
it is configured. Each system variable has a default value. System
variables can be set at server startup using options on the
command line or in an option file. Most of them can be changed
dynamically while the server is running by means of the
SET
statement, which enables you to modify operation of the server
without having to stop and restart it. You can refer to system
variable values in expressions.
There are several ways to see the names and values of system variables:
To see the values that a server will use based on its compiled-in defaults and any option files that it reads, use this command:
mysqld --verbose --help
To see the values that a server will use based on its compiled-in defaults, ignoring the settings in any option files, use this command:
mysqld --no-defaults --verbose --help
To see the current values used by a running server, use the
SHOW VARIABLES
statement.
This section provides a description of each system variable. Variables with no version indicated are present in all MySQL 5.7 releases.
The following table lists all available system variables.
Table 5.2 System Variable Summary
For additional system variable information, see these sections:
Section 5.1.5, “Using System Variables”, discusses the syntax for setting and displaying system variable values.
Section 5.1.5.2, “Dynamic System Variables”, lists the variables that can be set at runtime.
Information on tuning system variables can be found in Section 8.12.2, “Tuning Server Parameters”.
Section 14.12, “InnoDB Startup Options and System Variables”, lists
InnoDB
system variables.
Section 18.3.3.8.2, “MySQL Cluster System Variables”, lists system variables which are specific to MySQL Cluster.
For information on server system variables specific to replication, see Section 17.1.6, “Replication and Binary Logging Options and Variables”.
Some of the following variable descriptions refer to
“enabling” or “disabling” a variable.
These variables can be enabled with the
SET
statement by setting them to ON
or
1
, or disabled by setting them to
OFF
or 0
. Boolean
variables can be set at startup to the values
ON
, TRUE
,
OFF
, and FALSE
(not case
sensitive), as well as 1
and
0
. See Section 4.2.5, “Program Option Modifiers”.
Some system variables 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 a system variable 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 a variable 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 system variables 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 variable 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.
Command-Line Format | --autocommit[=#] | ||
System Variable | Name | autocommit | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | ON |
The autocommit mode. If set to 1, all changes to a table take
effect immediately. If set to 0, you must use
COMMIT
to accept a transaction
or ROLLBACK
to cancel it. If autocommit
is 0 and you change it to 1, MySQL performs an automatic
COMMIT
of any open transaction.
Another way to begin a transaction is to use a
START
TRANSACTION
or
BEGIN
statement. See Section 13.3.1, “START TRANSACTION, COMMIT, and ROLLBACK Syntax”.
By default, client connections begin with
autocommit
set to 1. To cause
clients to begin with a default of 0, set the global
autocommit
value by starting
the server with the
--autocommit=0
option. To set
the variable using an option file, include these lines:
[mysqld] autocommit=0
System Variable | Name | automatic_sp_privileges | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | TRUE |
When this variable has a value of 1 (the default), the server
automatically grants the
EXECUTE
and
ALTER ROUTINE
privileges to the
creator of a stored routine, if the user cannot already
execute and alter or drop the routine. (The
ALTER ROUTINE
privilege is
required to drop the routine.) The server also automatically
drops those privileges from the creator when the routine is
dropped. If
automatic_sp_privileges
is 0,
the server does not automatically add or drop these
privileges.
The creator of a routine is the account used to execute the
CREATE
statement for it. This might not be
the same as the account named as the
DEFINER
in the routine definition.
See also Section 20.2.2, “Stored Routines and MySQL Privileges”.
Introduced | 5.7.5 | ||
Command-Line Format | --auto_generate_certs[={OFF|ON}] | ||
System Variable | Name | auto_generate_certs | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean | |
Default | ON |
This variable is available if the server was compiled using OpenSSL (see Section 6.3.11.1, “OpenSSL Versus yaSSL”). It controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist.
At startup, the server automatically generates server-side and
client-side SSL certificate and key files in the data
directory if the
auto_generate_certs
system
variable is enabled, no SSL options other than
--ssl
are specified, and the
server-side SSL files are missing from the data directory.
These files enable secure client connections using SSL; see
Section 6.3.11.4, “Configuring MySQL to Use Secure Connections”.
For more information about SSL file autogeneration, including file names and characteristics, see Section 6.3.12.1, “Creating SSL and RSA Certificates and Keys using MySQL”
The
sha256_password_auto_generate_rsa_keys
system variable is related but controls autogeneration of RSA
key-pair files needed for secure password exchange using RSA
over unencypted connections.
Introduced | 5.7.6 | ||
Deprecated | 5.7.6 | ||
Command-Line Format | --avoid_temporal_upgrade={OFF|ON} | ||
System Variable | Name | avoid_temporal_upgrade | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
This variable controls whether ALTER
TABLE
implicitly upgrades temporal columns found to
be in pre-5.6.4 format (TIME
,
DATETIME
, and
TIMESTAMP
columns without
support for fractional seconds precision). Upgrading such
columns requires a table rebuild, which prevents any use of
fast alterations that might otherwise apply to the operation
to be performed.
This variable is disabled by default. Enabling it causes
ALTER TABLE
not to rebuild
temporal columns and thereby be able to take advantage of
possible fast alterations.
This variable is deprecated and will be removed in a future MySQL release.
System Variable | Name | back_log | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | -1 (autosized) | ||
Min Value | 1 | ||
Max Value | 65535 |
The number of outstanding connection requests MySQL can have.
This comes into play when the main MySQL thread gets very many
connection requests in a very short time. It then takes some
time (although very little) for the main thread to check the
connection and start a new thread. The
back_log
value indicates how
many requests can be stacked during this short time before
MySQL momentarily stops answering new requests. You need to
increase this only if you expect a large number of connections
in a short period of time.
In other words, this value is the size of the listen queue for
incoming TCP/IP connections. Your operating system has its own
limit on the size of this queue. The manual page for the Unix
listen()
system call should have more
details. Check your OS documentation for the maximum value for
this variable. back_log
cannot be set higher than your operating system limit.
The default value is based on the following formula, capped to a limit of 900:
50 + (max_connections / 5)
Command-Line Format | --basedir=dir_name | ||
System Variable | Name | basedir | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | directory name |
The MySQL installation base directory. This variable can be
set with the --basedir
option.
Relative path names for other variables usually are resolved
relative to the base directory.
Command-Line Format | --big-tables | ||
System Variable | Name | big_tables | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
If set to 1, all temporary tables are stored on disk rather
than in memory. This is a little slower, but the error
The table
does not occur for
tbl_name
is
fullSELECT
operations that require
a large temporary table. The default value for a new
connection is 0 (use in-memory temporary tables). Normally,
you should never need to set this variable, because in-memory
tables are automatically converted to disk-based tables as
required.
Command-Line Format | --bind-address=addr | ||
System Variable | Name | bind_address | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string | |
Default | * |
The value of the --bind-address
option.
This variable has no effect for the embedded server
(libmysqld
) and as of MySQL 5.7.2 is no
longer visible within the embedded server.
Introduced | 5.7.4 | ||
Command-Line Format | --block_encryption_mode=# | ||
System Variable | Name | block_encryption_mode | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | aes-128-ecb |
This variable controls the block encryption mode for
block-based algorithms such as AES. It affects encryption for
AES_ENCRYPT()
and
AES_DECRYPT()
.
block_encryption_mode
takes a
value in
aes-
format, where keylen
-mode
keylen
is the key
length in bits and mode
is the
encryption mode. The value is not case sensitive. Permitted
keylen
values are 128, 192, and
256. Permitted encryption modes depend on whether MySQL was
compiled using OpenSSL or yaSSL:
For OpenSSL, permitted mode
values are: ECB
,
CBC
, CFB1
,
CFB8
, CFB128
,
OFB
For yaSSL, permitted mode
values are: ECB
, CBC
For example, this statement causes the AES encryption functions to use a key length of 256 bits and the CBC mode:
SET block_encryption_mode = 'aes-256-cbc';
An error occurs for attempts to set
block_encryption_mode
to a
value containing an unsupported key length or a mode that the
SSL library does not support.
Command-Line Format | --bulk_insert_buffer_size=# | ||
System Variable | Name | bulk_insert_buffer_size | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 8388608 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 8388608 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 |
MyISAM
uses a special tree-like cache to
make bulk inserts faster for
INSERT ...
SELECT
, INSERT ... VALUES (...), (...),
...
, and
LOAD DATA
INFILE
when adding data to nonempty tables. This
variable limits the size of the cache tree in bytes per
thread. Setting it to 0 disables this optimization. The
default value is 8MB.
System Variable | Name | character_set_client | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
The character set for statements that arrive from the client.
The session value of this variable is set using the character
set requested by the client when the client connects to the
server. (Many clients support a
--default-character-set
option to enable this
character set to be specified explicitly. See also
Section 10.1.4, “Connection Character Sets and Collations”.) The global value of the
variable is used to set the session value in cases when the
client-requested value is unknown or not available, or the
server is configured to ignore client requests:
The client is from a version of MySQL older than MySQL 4.1, and thus does not request a character set.
The client requests a character set not known to the
server. For example, a Japanese-enabled client requests
sjis
when connecting to a server not
configured with sjis
support.
mysqld was started with the
--skip-character-set-client-handshake
option, which causes it to ignore client character set
configuration. This reproduces MySQL 4.0 behavior and is
useful should you wish to upgrade the server without
upgrading all the clients.
ucs2
, utf16
,
utf16le
, and utf32
cannot be used as a client character set, which means that
they also do not work for SET NAMES
or
SET CHARACTER SET
.
System Variable | Name | character_set_connection | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
The character set used for literals that do not have a character set introducer and for number-to-string conversion.
System Variable | Name | character_set_database | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Footnote | This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | ||
Permitted Values | Type | string |
The character set used by the default database. The server
sets this variable whenever the default database changes. If
there is no default database, the variable has the same value
as character_set_server
.
The global
character_set_database
and
collation_database
system
variables are deprecated as of MySQL 5.7.6 and will be removed
in a future version of MySQL.
Assigning a value to the session
character_set_database
and
collation_database
system
variables is deprecated as of MySQL 5.7.6 and assignments
produce a warning. The session variables will become read only
in a future version of MySQL and assignments will produce an
error. It will remain possible to access the session variables
to determine the database character set and collation for the
default database.
Command-Line Format | --character-set-filesystem=name | ||
System Variable | Name | character_set_filesystem | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | binary |
The file system character set. This variable is used to
interpret string literals that refer to file names, such as in
the LOAD DATA
INFILE
and
SELECT ... INTO
OUTFILE
statements and the
LOAD_FILE()
function. Such file
names are converted from
character_set_client
to
character_set_filesystem
before the file opening attempt occurs. The default value is
binary
, which means that no conversion
occurs. For systems on which multibyte file names are
permitted, a different value may be more appropriate. For
example, if the system represents file names using UTF-8, set
character_set_filesystem
to
'utf8'
.
System Variable | Name | character_set_results | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
The character set used for returning query results such as result sets or error messages to the client.
Command-Line Format | --character-set-server | ||
System Variable | Name | character_set_server | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | latin1 |
The server's default character set.
System Variable | Name | character_set_system | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string | |
Default | utf8 |
The character set used by the server for storing identifiers.
The value is always utf8
.
Command-Line Format | --character-sets-dir=dir_name | ||
System Variable | Name | character_sets_dir | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | directory name |
The directory where character sets are installed.
Introduced | 5.7.7 | ||
Command-Line Format | --check_proxy_users=[={OFF|ON}] | ||
System Variable | Name | check_proxy_users | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
This variable controls whether the server performs proxy user
mapping for authentication plugins that request it. With
check_proxy_users
enabled, it
may also be necessary to enable plugin-specific system
variables to take advantage of server proxy user mapping
support:
For the mysql_native_password
plugin,
enable
mysql_native_password_proxy_users
.
For the sha256_password
plugin, enable
sha256_password_proxy_users
.
For information about user proxying, see Section 6.3.9, “Proxy Users”.
This variable was added in MySQL 5.7.7. Before 5.7.7, proxy user mapping is available only for plugins that implement it for themselves.
System Variable | Name | collation_connection | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
The collation of the connection character set.
System Variable | Name | collation_database | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Footnote | This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | ||
Permitted Values | Type | string |
The collation used by the default database. The server sets
this variable whenever the default database changes. If there
is no default database, the variable has the same value as
collation_server
.
The global
character_set_database
and
collation_database
system
variables are deprecated as of MySQL 5.7.6 and will be removed
in a future version of MySQL.
Assigning a value to the session
character_set_database
and
collation_database
system
variables is deprecated as of MySQL 5.7.6 and assignments
produce a warning. The session variables will become read only
in a future version of MySQL and assignments will produce an
error. It will remain possible to access the session variables
to determine the database character set and collation for the
default database.
Command-Line Format | --collation-server | ||
System Variable | Name | collation_server | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | latin1_swedish_ci |
The server's default collation.
Command-Line Format | --completion_type=# | ||
System Variable | Name | completion_type | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | NO_CHAIN | ||
Valid Values | NO_CHAIN | ||
CHAIN | |||
RELEASE | |||
0 | |||
1 | |||
2 |
The transaction completion type. This variable can take the values shown in the following table. The variable can be assigned using either the name values or corresponding integer values.
Value | Description |
---|---|
NO_CHAIN (or 0) | COMMIT and
ROLLBACK
are unaffected. This is the default value. |
CHAIN (or 1) | COMMIT and
ROLLBACK
are equivalent to COMMIT AND CHAIN
and ROLLBACK AND CHAIN ,
respectively. (A new transaction starts immediately
with the same isolation level as the just-terminated
transaction.) |
RELEASE (or 2) | COMMIT and
ROLLBACK
are equivalent to COMMIT RELEASE
and ROLLBACK RELEASE , respectively.
(The server disconnects after terminating the
transaction.) |
completion_type
affects
transactions that begin with
START
TRANSACTION
or
BEGIN
and
end with COMMIT
or
ROLLBACK
. It
does not apply to implicit commits resulting from execution of
the statements listed in Section 13.3.3, “Statements That Cause an Implicit Commit”. It
also does not apply for
XA
COMMIT
,
XA
ROLLBACK
, or when
autocommit=1
.
Command-Line Format | --concurrent_insert[=#] | ||
System Variable | Name | concurrent_insert | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | AUTO | ||
Valid Values | NEVER | ||
AUTO | |||
ALWAYS | |||
0 | |||
1 | |||
2 |
If AUTO
(the default), MySQL permits
INSERT
and
SELECT
statements to run
concurrently for MyISAM
tables that have no
free blocks in the middle of the data file. If you start
mysqld with
--skip-new
,
this variable is set to NEVER
.
This variable can take the values shown in the following table. The variable can be assigned using either the name values or corresponding integer values.
Value | Description |
---|---|
NEVER (or 0) | Disables concurrent inserts |
AUTO (or 1) | (Default) Enables concurrent insert for MyISAM tables
that do not have holes |
ALWAYS (or 2) | Enables concurrent inserts for all MyISAM tables,
even those that have holes. For a table with a hole,
new rows are inserted at the end of the table if it is
in use by another thread. Otherwise, MySQL acquires a
normal write lock and inserts the row into the hole. |
See also Section 8.11.3, “Concurrent Inserts”.
Command-Line Format | --connect_timeout=# | ||
System Variable | Name | connect_timeout | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 10 | ||
Min Value | 2 | ||
Max Value | 31536000 |
The number of seconds that the mysqld
server waits for a connect packet before responding with
Bad handshake
. The default value is 10
seconds.
Increasing the
connect_timeout
value might
help if clients frequently encounter errors of the form
Lost connection to MySQL server at
'
.
XXX
', system error:
errno
System Variable | Name | core_file | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean | |
Default | OFF |
Whether to write a core file if the server crashes. This
variable is set by the
--core-file
option.
Command-Line Format | --datadir=dir_name | ||
System Variable | Name | datadir | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | directory name |
The MySQL data directory. This variable can be set with the
--datadir
option.
This variable is unused. It is deprecated and will be removed in a future MySQL release.
This variable is unused. It is deprecated and will be removed in a future MySQL release.
Command-Line Format | --debug[=debug_options] | ||
System Variable | Name | debug | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (Unix) | Type | string | |
Default | d:t:i:o,/tmp/mysqld.trace | ||
Permitted Values (Windows) | Type | string | |
Default | d:t:i:O,\mysqld.trace |
This variable indicates the current debugging settings. It is
available only for servers built with debugging support. The
initial value comes from the value of instances of the
--debug
option given at server
startup. The global and session values may be set at runtime;
the SUPER
privilege is
required, even for the session value.
Assigning a value that begins with +
or
-
cause the value to added to or subtracted
from the current value:
mysql>SET debug = 'T';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | T | +---------+ mysql>SET debug = '+P';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | P:T | +---------+ mysql>SET debug = '-P';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | T | +---------+
For more information, see Section 25.5.3, “The DBUG Package”.
System Variable | Name | debug_sync | |
Variable Scope | Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
This variable is the user interface to the Debug Sync
facility. Use of Debug Sync requires that MySQL be configured
with the -DENABLE_DEBUG_SYNC=1
CMake option (see
Section 2.9.4, “MySQL Source-Configuration Options”). If Debug Sync
is not compiled in, this system variable is not available.
The global variable value is read only and indicates whether
the facility is enabled. By default, Debug Sync is disabled
and the value of debug_sync
is OFF
. If the server is started with
--debug-sync-timeout=
,
where N
N
is a timeout value greater
than 0, Debug Sync is enabled and the value of
debug_sync
is ON -
current signal
followed by the signal name. Also,
N
becomes the default timeout for
individual synchronization points.
The session value can be read by any user and will have the
same value as the global variable. The session value can be
set by users that have the
SUPER
privilege to control
synchronization points.
For a description of the Debug Sync facility and how to use synchronization points, see MySQL Internals: Test Synchronization.
Introduced | 5.7.2 | ||
Command-Line Format | --default-authentication-plugin=plugin_name | ||
System Variable | Name | default_authentication_plugin | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | enumeration | |
Default | mysql_native_password | ||
Valid Values | mysql_native_password | ||
sha256_password |
The default authentication plugin. Permitted values are
mysql_native_password
(use MySQL native
passwords; this is the default) and
sha256_password
(use SHA-256 passwords).
For more information about these plugins, see
Section 6.4.1.1, “The Native Authentication Plugin”, and
Section 6.4.1.4, “The SHA-256 Authentication Plugin”.
If you use this variable to change the default
authentication plugin to a value other than
mysql_native_password
, clients older than
MySQL 5.5.6 will no longer be able to connect because they
will not understand the resulting change to the
authentication protocol.
The value of
default_authentication_plugin
affects these aspects of server operation:
It determines which authentication plugin the server
assigns to new accounts created by
CREATE USER
and
GRANT
statements that do
not name a plugin explicitly with an IDENTIFIED
WITH
clause.
It sets the old_passwords
system variable at startup to the value that is consistent
with the password hashing method required by the default
plugin. The old_passwords
value affects hashing of passwords specified in the
IDENTIFIED BY
clause of
CREATE USER
and
GRANT
, and passwords
specified as the argument to the
PASSWORD()
function.
For an account created with either of the following
statements, the server associates the account with the
default authentication plugin and assigns the account the
given password, hashed according to the value of
old_passwords
.
CREATE USER ... IDENTIFIED BY 'cleartext password
'; GRANT ... IDENTIFIED BY 'cleartext password
';
For an account created with either of the following statements, the statement fails if the password hash is not encrypted using the hash format required by the default authentication plugin. Otherwise, the server associates the account with the default authentication plugin and assigns the account the given password hash.
CREATE USER ... IDENTIFIED BY PASSWORD 'encrypted password
'; GRANT ... IDENTIFIED BY PASSWORD 'encrypted password
';
This variable was added in MySQL 5.7.2. Earlier in MySQL
5.7, use the
--default-authentication-plugin
command-line option instead, which is used the same way at
server startup, but cannot be accessed at runtime.
Introduced | 5.7.4 | ||
Command-Line Format | --default_password_lifetime=# | ||
System Variable | Name | default_password_lifetime | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (<= 5.7.10) | Type | integer | |
Default | 360 | ||
Min Value | 0 | ||
Max Value | 65535 | ||
Permitted Values (>= 5.7.11) | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 65535 |
This variable defines the global automatic password expiration
policy. It applies to accounts that use MySQL built-in
authentication methods (accounts that use an authentication
plugin of mysql_native_password
,
mysql_old_password
, or
sha256_password
).
The default
default_password_lifetime
value is 0, which disables automatic password expiration. If
the value of
default_password_lifetime
is
a positive integer N
, it indicates
the permitted password lifetime; passwords must be changed
every N
days.
The global password expiration policy can be overridden as
desired for individual accounts using the ALTER
USER
statement. See
Section 6.3.6, “Password Expiration Policy”.
From MySQL 5.7.4 to 5.7.10, the default
default_password_lifetime
value is 360 (passwords must be changed approximately once
per year). For those versions, be aware that, if you make no
changes to the
default_password_lifetime
variable or to individual user accounts, all user passwords
will expire after 360 days, and all user accounts will start
running in restricted mode when this happens. Clients (which
are effectively users) connecting to the server will then
get an error indicating that the password must be changed:
ERROR 1820 (HY000): You must reset your password
using ALTER USER statement before executing this
statement.
However, this is easy to miss for clients that automatically connect to the server, such as connections made from scripts. To avoid having such clients suddenly stop working due to a password expiring, make sure to change the password expiration settings for those clients, like this:
ALTER USER 'script'@'localhost' PASSWORD EXPIRE NEVER
Alternatively, set the
default_password_lifetime
variable to 0
, thus disabling automatic
password expiration for all users.
Command-Line Format | --default-storage-engine=name | ||
System Variable | Name | default_storage_engine | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | InnoDB |
The default storage engine. This variable sets the storage
engine for permanent tables only. To set the storage engine
for TEMPORARY
tables, set the
default_tmp_storage_engine
system variable.
To see which storage engines are available and enabled, use
the SHOW ENGINES
statement or
query the INFORMATION_SCHEMA
ENGINES
table.
default_storage_engine
should
be used in preference to
storage_engine
, which is
deprecated and was removed in MySQL 5.7.5.
If you disable the default storage engine at server startup,
you must set the default engine for both permanent and
TEMPORARY
tables to a different engine or
the server will not start.
Command-Line Format | --default_tmp_storage_engine=name | ||
System Variable | Name | default_tmp_storage_engine | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | InnoDB |
The default storage engine for TEMPORARY
tables (created with
CREATE TEMPORARY
TABLE
). To set the storage engine for permanent
tables, set the
default_storage_engine
system
variable. Also see the discussion of that variable regarding
possible values.
If you disable the default storage engine at server startup,
you must set the default engine for both permanent and
TEMPORARY
tables to a different engine or
the server will not start.
Command-Line Format | --default_week_format=# | ||
System Variable | Name | default_week_format | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 7 |
The default mode value to use for the
WEEK()
function. See
Section 12.7, “Date and Time Functions”.
Command-Line Format | --delay-key-write[=name] | ||
System Variable | Name | delay_key_write | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | ON | ||
Valid Values | ON | ||
OFF | |||
ALL |
This option applies only to MyISAM
tables.
It can have one of the following values to affect handling of
the DELAY_KEY_WRITE
table option that can
be used in CREATE TABLE
statements.
Option | Description |
---|---|
OFF | DELAY_KEY_WRITE is ignored. |
ON | MySQL honors any DELAY_KEY_WRITE option specified in
CREATE TABLE
statements. This is the default value. |
ALL | All new opened tables are treated as if they were created with the
DELAY_KEY_WRITE option enabled. |
If DELAY_KEY_WRITE
is enabled for a table,
the key buffer is not flushed for the table on every index
update, but only when the table is closed. This speeds up
writes on keys a lot, but if you use this feature, you should
add automatic checking of all MyISAM
tables
by starting the server with the
--myisam-recover-options
option
(for example,
--myisam-recover-options=BACKUP,FORCE
).
See Section 5.1.3, “Server Command Options”, and
Section 15.2.1, “MyISAM Startup Options”.
If you enable external locking with
--external-locking
, there is
no protection against index corruption for tables that use
delayed key writes.
Deprecated | 5.6.7 | ||
Command-Line Format | --delayed_insert_limit=# | ||
System Variable | Name | delayed_insert_limit | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 100 | ||
Min Value | 1 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 100 | ||
Min Value | 1 | ||
Max Value | 18446744073709551615 |
This system variable is deprecated (because
DELAYED
inserts are not supported), and
will be removed in a future release.
Deprecated | 5.6.7 | ||
Command-Line Format | --delayed_insert_timeout=# | ||
System Variable | Name | delayed_insert_timeout | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 300 |
This system variable is deprecated (because
DELAYED
inserts are not supported), and
will be removed in a future release.
Deprecated | 5.6.7 | ||
Command-Line Format | --delayed_queue_size=# | ||
System Variable | Name | delayed_queue_size | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 1000 | ||
Min Value | 1 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 1000 | ||
Min Value | 1 | ||
Max Value | 18446744073709551615 |
This system variable is deprecated (because
DELAYED
inserts are not supported), and
will be removed in a future release.
Introduced | 5.7.8 | ||
Command-Line Format | --disabled_storage_engines=engine[,engine]... | ||
System Variable | Name | disabled_storage_engines | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string | |
Default | empty string |
This variable indicates which storage engines cannot be used
to create tables or tablespaces. For example, to prevent new
MyISAM
or FEDERATED
tables from being created, start the server with these lines
in the server option file:
[mysqld] disabled_storage_engines="MyISAM,FEDERATED"
By default,
disabled_storage_engines
is
empty (no engines disabled), but it can be set to a
comma-separated list of one or more engines (not case
sensitive). Any engine named in the value cannot be used to
create tables or tablespaces with CREATE
TABLE
or CREATE
TABLESPACE
, and cannot be used with
ALTER TABLE ...
ENGINE
or
ALTER
TABLESPACE ... ENGINE
to change the storage engine
of existing tables or tablespaces. Attempts to do so result in
an ER_DISABLED_STORAGE_ENGINE
error.
disabled_storage_engines
does
not restrict other DDL statements for existing tables, such as
CREATE INDEX
,
TRUNCATE TABLE
,
ANALYZE TABLE
,
DROP TABLE
, or
DROP TABLESPACE
. This permits a
smooth transition so that existing tables or tablespaces that
use a disabled engine can be migrated to a permitted engine by
means such as
ALTER TABLE ...
ENGINE
.
permitted_engine
It is permitted to set the
default_storage_engine
or
default_tmp_storage_engine
system variable to a storage engine that is disabled. This
could cause applications to behave erratically or fail,
although that might be a useful technique in a development
environment for identifying applications that use disabled
engines, so that they can be modified.
disabled_storage_engines
is
disabled and has no effect if the server is started with any
of these options: --bootstrap
,
--initialize
,
--initialize-insecure
,
--skip-grant-tables
.
disconnect_on_expired_password
Introduced | 5.7.1 | ||
Command-Line Format | --disconnect_on_expired_password[=#] | ||
System Variable | Name | disconnect_on_expired_password | |
Variable Scope | Session | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean | |
Default | ON |
This variable controls how the server handles clients with expired passwords:
If the client indicates that it can handle expires
passwords, the value of
disconnect_on_expired_password
is irrelevant. The server permits the client to connect
but puts it in sandbox mode.
If the client does not indicate that it can handle expires
passwords, the server handles the client according to the
value of
disconnect_on_expired_password
:
If
disconnect_on_expired_password
:
is enabled, the server disconnects the client.
If
disconnect_on_expired_password
:
is disabled, the server permits the client to connect
but puts it in sandbox mode.
For more information about the interaction of client and server settings relating to expired-password handling, see Section 6.3.7, “Password Expiration and Sandbox Mode”.
Command-Line Format | --div_precision_increment=# | ||
System Variable | Name | div_precision_increment | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 4 | ||
Min Value | 0 | ||
Max Value | 30 |
This variable indicates the number of digits by which to
increase the scale of the result of division operations
performed with the
/
operator.
The default value is 4. The minimum and maximum values are 0
and 30, respectively. The following example illustrates the
effect of increasing the default value.
mysql>SELECT 1/7;
+--------+ | 1/7 | +--------+ | 0.1429 | +--------+ mysql>SET div_precision_increment = 12;
mysql>SELECT 1/7;
+----------------+ | 1/7 | +----------------+ | 0.142857142857 | +----------------+
System Variable | Name | end_markers_in_json | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Whether optimizer JSON output should add end markers.
System Variable | Name | eq_range_index_dive_limit | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (<= 5.7.3) | Type | integer | |
Default | 10 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (>= 5.7.4) | Type | integer | |
Default | 200 | ||
Min Value | 0 | ||
Max Value | 4294967295 |
This variable indicates the number of equality ranges in an
equality comparison condition when the optimizer should switch
from using index dives to index statistics in estimating the
number of qualifying rows. It applies to evaluation of
expressions that have either of these equivalent forms, where
the optimizer uses a nonunique index to look up
col_name
values:
col_name
IN(val1
, ...,valN
)col_name
=val1
OR ... ORcol_name
=valN
In both cases, the expression contains
N
equality ranges. The optimizer
can make row estimates using index dives or index statistics.
If eq_range_index_dive_limit
is greater than 0, the optimizer uses existing index
statistics instead of index dives if there are
eq_range_index_dive_limit
or
more equality ranges. Thus, to permit use of index dives for
up to N
equality ranges, set
eq_range_index_dive_limit
to
N
+ 1. To disable use of index
statistics and always use index dives regardless of
N
, set
eq_range_index_dive_limit
to
0.
For more information, see Section 8.2.1.3.3, “Equality Range Optimization of Many-Valued Comparisons”.
To update table index statistics for best estimates, use
ANALYZE TABLE
.
The number of errors that resulted from the last statement that generated messages. This variable is read only. See Section 13.7.5.17, “SHOW ERRORS Syntax”.
Command-Line Format | --event-scheduler[=value] | ||
System Variable | Name | event_scheduler | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | OFF | ||
Valid Values | ON | ||
OFF | |||
DISABLED |
This variable indicates the status of the Event Scheduler;
possible values are ON
,
OFF
, and DISABLED
, with
the default being OFF
. This variable and
its effects on the Event Scheduler's operation are discussed
in greater detail in the
Overview section
of the Events chapter.
Command-Line Format | --expire_logs_days=# | ||
System Variable | Name | expire_logs_days | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 99 |
The number of days for automatic binary log file removal. The default is 0, which means “no automatic removal.” Possible removals happen at startup and when the binary log is flushed. Log flushing occurs as indicated in Section 5.2, “MySQL Server Logs”.
To remove binary log files manually, use the
PURGE BINARY LOGS
statement.
See Section 13.4.1.1, “PURGE BINARY LOGS Syntax”.
explicit_defaults_for_timestamp
Deprecated | 5.6.6 | ||
Command-Line Format | --explicit_defaults_for_timestamp=# | ||
System Variable | Name | explicit_defaults_for_timestamp | |
Variable Scope | Global, Session | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean | |
Default | FALSE |
In MySQL, the TIMESTAMP
data
type differs in nonstandard ways from other data types:
TIMESTAMP
columns not
explicitly declared with the NULL
attribute are assigned the NOT NULL
attribute. (Columns of other data types, if not explicitly
declared as NOT NULL
, permit
NULL
values.) Setting such a column to
NULL
sets it to the current timestamp.
The first TIMESTAMP
column
in a table, if not declared with the
NULL
attribute or an explicit
DEFAULT
or ON UPDATE
clause, is automatically assigned the DEFAULT
CURRENT_TIMESTAMP
and ON UPDATE
CURRENT_TIMESTAMP
attributes.
TIMESTAMP
columns following
the first one, if not declared with the
NULL
attribute or an explicit
DEFAULT
clause, are automatically
assigned DEFAULT '0000-00-00 00:00:00'
(the “zero” timestamp). For inserted rows
that specify no explicit value for such a column, the
column is assigned '0000-00-00
00:00:00'
and no warning occurs.
Those nonstandard behaviors remain the default for
TIMESTAMP
but as of MySQL 5.6.6
are deprecated and this warning appears at startup:
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
As indicated by the warning, to turn off the nonstandard
behaviors, enable the
explicit_defaults_for_timestamp
system variable at server startup. With this variable enabled,
the server handles TIMESTAMP
as
follows instead:
TIMESTAMP
columns not
explicitly declared as NOT NULL
permit
NULL
values. Setting such a column to
NULL
sets it to
NULL
, not the current timestamp.
No TIMESTAMP
column is
assigned the DEFAULT CURRENT_TIMESTAMP
or ON UPDATE CURRENT_TIMESTAMP
attributes automatically. Those attributes must be
explicitly specified.
TIMESTAMP
columns declared
as NOT NULL
and without an explicit
DEFAULT
clause are treated as having no
default value. For inserted rows that specify no explicit
value for such a column, the result depends on the SQL
mode. If strict SQL mode is enabled, an error occurs. If
strict SQL mode is not enabled, the column is assigned the
implicit default of '0000-00-00
00:00:00'
and a warning occurs. This is similar
to how MySQL treats other temporal types such as
DATETIME
.
explicit_defaults_for_timestamp
is itself deprecated because its only purpose is to permit
control over now-deprecated
TIMESTAMP
behaviors that will
be removed in a future MySQL release. When that removal
occurs,
explicit_defaults_for_timestamp
will have no purpose and will be removed as well.
System Variable | Name | external_user | |
Variable Scope | Session | ||
Dynamic Variable | No | ||
Permitted Values | Type | string |
The external user name used during the authentication process,
as set by the plugin used to authenticate the client. With
native (built-in) MySQL authentication, or if the plugin does
not set the value, this variable is NULL
.
See Section 6.3.9, “Proxy Users”.
Command-Line Format | --flush | ||
System Variable | Name | flush | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
If ON
, the server flushes (synchronizes)
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”. This
variable is set to ON
if you start
mysqld with the
--flush
option.
Command-Line Format | --flush_time=# | ||
System Variable | Name | flush_time | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Permitted Values (Windows) | Type | integer | |
Default | 0 | ||
Min Value | 0 |
If this is set to a nonzero value, all tables are closed every
flush_time
seconds to free up
resources and synchronize unflushed data to disk. This option
is best used only on systems with minimal resources.
If set to 1 (the default), foreign key constraints for
InnoDB
tables are checked. If set to 0,
foreign key constraints are ignored, with a couple of
exceptions. When re-creating a table that was dropped, an
error is returned if the table definition does not conform to
the foreign key constraints referencing the table. Likewise,
an ALTER TABLE
operation
returns an error if a foreign key definition is incorrectly
formed. For more information, see
Section 13.1.18.3, “Using FOREIGN KEY Constraints”.
Setting this variable has the same effect on
NDB
tables as it does for
InnoDB
tables. Typically you leave this
setting enabled during normal operation, to enforce
referential
integrity. Disabling foreign key checking can be useful
for reloading InnoDB
tables in an order
different from that required by their parent/child
relationships. See
Section 14.6.6, “InnoDB and FOREIGN KEY Constraints”.
Setting foreign_key_checks
to 0 also
affects data definition statements:
DROP
SCHEMA
drops a schema even if it contains tables
that have foreign keys that are referred to by tables outside
the schema, and DROP TABLE
drops tables that have foreign keys that are referred to by
other tables.
Setting foreign_key_checks
to 1 does not
trigger a scan of the existing table data. Therefore, rows
added to the table while
foreign_key_checks = 0
will
not be verified for consistency.
Command-Line Format | --ft_boolean_syntax=name | ||
System Variable | Name | ft_boolean_syntax | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | + -><()~*:""&| |
The list of operators supported by boolean full-text searches
performed using IN BOOLEAN MODE
. See
Section 12.9.2, “Boolean Full-Text Searches”.
The default variable value is
'+ -><()~*:""&|'
. The rules
for changing the value are as follows:
Operator function is determined by position within the string.
The replacement value must be 14 characters.
Each character must be an ASCII nonalphanumeric character.
Either the first or second character must be a space.
No duplicates are permitted except the phrase quoting operators in positions 11 and 12. These two characters are not required to be the same, but they are the only two that may be.
Positions 10, 13, and 14 (which by default are set to
“:
”,
“&
”, and
“|
”) are reserved for
future extensions.
Command-Line Format | --ft_max_word_len=# | ||
System Variable | Name | ft_max_word_len | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Min Value | 10 |
The maximum length of the word to be included in a
MyISAM
FULLTEXT
index.
FULLTEXT
indexes on
MyISAM
tables must be rebuilt after
changing this variable. Use REPAIR TABLE
.
tbl_name
QUICK
Command-Line Format | --ft_min_word_len=# | ||
System Variable | Name | ft_min_word_len | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | 4 | ||
Min Value | 1 |
The minimum length of the word to be included in a
MyISAM
FULLTEXT
index.
FULLTEXT
indexes on
MyISAM
tables must be rebuilt after
changing this variable. Use REPAIR TABLE
.
tbl_name
QUICK
Command-Line Format | --ft_query_expansion_limit=# | ||
System Variable | Name | ft_query_expansion_limit | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | 20 | ||
Min Value | 0 | ||
Max Value | 1000 |
The number of top matches to use for full-text searches
performed using WITH QUERY EXPANSION
.
Command-Line Format | --ft_stopword_file=file_name | ||
System Variable | Name | ft_stopword_file | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | file name |
The file from which to read the list of stopwords for
full-text searches on MyISAM
tables. The
server looks for the file in the data directory unless an
absolute path name is given to specify a different directory.
All the words from the file are used; comments are
not honored. By default, a built-in list
of stopwords is used (as defined in the
storage/myisam/ft_static.c
file). Setting
this variable to the empty string (''
)
disables stopword filtering. See also
Section 12.9.4, “Full-Text Stopwords”.
FULLTEXT
indexes on
MyISAM
tables must be rebuilt after
changing this variable or the contents of the stopword file.
Use REPAIR TABLE
.
tbl_name
QUICK
Command-Line Format | --general-log | ||
System Variable | Name | general_log | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Whether the general query log is enabled. The value can be 0
(or OFF
) to disable the log or 1 (or
ON
) to enable the log. The default value
depends on whether the
--general_log
option is given.
The destination for log output is controlled by the
log_output
system variable;
if that value is NONE
, no log entries are
written even if the log is enabled.
Command-Line Format | --general-log-file=file_name | ||
System Variable | Name | general_log_file | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | file name | |
Default | host_name.log |
The name of the general query log file. The default value is
,
but the initial value can be changed with the
host_name
.log--general_log_file
option.
Command-Line Format | --group_concat_max_len=# | ||
System Variable | Name | group_concat_max_len | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 1024 | ||
Min Value | 4 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 1024 | ||
Min Value | 4 | ||
Max Value | 18446744073709551615 |
The maximum permitted result length in bytes for the
GROUP_CONCAT()
function. The
default is 1024.
YES
if the zlib
compression library is available to the server,
NO
if not. If not, the
COMPRESS()
and
UNCOMPRESS()
functions cannot
be used.
YES
if the crypt()
system call is available to the server, NO
if not. If not, the ENCRYPT()
function cannot be used.
YES
if mysqld supports
dynamic loading of plugins, NO
if not.
YES
if the server supports spatial data
types, NO
if not.
This variable is an alias for
have_ssl
.
YES
if statement profiling capability is
present, NO
if not. If present, the
profiling
system variable controls whether
this capability is enabled or disabled. See
Section 13.7.5.31, “SHOW PROFILES Syntax”.
This variable is deprecated and will be removed in a future MySQL release.
YES
if mysqld supports
the query cache, NO
if not.
YES
if RTREE
indexes are
available, NO
if not. (These are used for
spatial indexes in MyISAM
tables.)
YES
if mysqld supports
SSL connections, NO
if not.
DISABLED
indicates that the server was
compiled with SSL support, but was not started with the
appropriate
--ssl-
options.
For more information, see
Section 6.3.11.2, “Building MySQL with Support for Secure Connections”.
xxx
Introduced | 5.7.4 | ||
System Variable | Name | have_statement_timeout | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean |
Whether the statement execution timeout feature is available
(see Statement Execution Time Optimizer Hints). The
value can be NO
if the background thread
used by this feature could not be initialized.
YES
if symbolic link support is enabled,
NO
if not. This is required on Unix for
support of the DATA DIRECTORY
and
INDEX DIRECTORY
table options. If the
server is started with the
--skip-symbolic-links
option, the value is DISABLED
.
This variable has no meaning on Windows.
System Variable | Name | host_cache_size | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | -1 (autosized) | ||
Min Value | 0 | ||
Max Value | 65536 |
The size of the internal host cache (see
Section 8.12.6.2, “DNS Lookup Optimization and the Host Cache”). Setting the size to 0 disables
the host cache. Changing the cache size at runtime implicitly
causes a FLUSH
HOSTS
operation to clear the host cache and truncate
the host_cache
table.
The default value is 128, plus 1 for a value of
max_connections
up to 500,
plus 1 for every increment of 20 over 500 in the
max_connections
value, capped
to a limit of 2000.
Use of --skip-host-cache
is
similar to setting the
host_cache_size
system
variable to 0, but
host_cache_size
is 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 of
host_cache_size
, but such
changes have no effect and the cache is not re-enabled even if
host_cache_size
is set larger
than 0.
System Variable | Name | hostname | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string |
The server sets this variable to the server host name at startup.
This variable is a synonym for the
last_insert_id
variable. It
exists for compatibility with other database systems. You can
read its value with SELECT @@identity
, and
set it using SET identity
.
System Variable | Name | ignore_db_dirs | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string |
A comma-separated list of names that are not considered as
database directories in the data directory. The value is set
from any instances of
--ignore-db-dir
given at server
startup.
As of MySQL 5.7.11,
--ignore-db-dir
can be used at
data directory initialization time with mysqld
--initialize to specify directories that the server
should ignore for purposes of assessing whether an existing
data directory is considered empty. See
Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.
Command-Line Format | --init-connect=name | ||
System Variable | Name | init_connect | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
A string to be executed by the server for each client that
connects. The string consists of one or more SQL statements,
separated by semicolon characters. For example, each client
session begins by default with autocommit mode enabled. For
older servers (before MySQL 5.5.8), there is no global
autocommit
system variable to
specify that autocommit should be disabled by default, but as
a workaround init_connect
can
be used to achieve the same effect:
SET GLOBAL init_connect='SET autocommit=0';
The init_connect
variable can
also be set on the command line or in an option file. To set
the variable as just shown using an option file, include these
lines:
[mysqld] init_connect='SET autocommit=0'
The content of init_connect
is not executed for users that have the
SUPER
privilege. This is done
so that an erroneous value for
init_connect
does not prevent
all clients from connecting. For example, the value might
contain a statement that has a syntax error, thus causing
client connections to fail. Not executing
init_connect
for users that
have the SUPER
privilege
enables them to open a connection and fix the
init_connect
value.
The server discards any result sets produced by statements in
the value of of init_connect
.
Command-Line Format | --init-file=file_name | ||
System Variable | Name | init_file | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | file name |
The name of the file specified with the
--init-file
option when you
start the server. This should be a file containing SQL
statements that you want the server to execute when it starts.
Each statement must be on a single line and should not include
comments. For more information, see the description of
--init-file
.
innodb_
xxx
InnoDB
system variables are
listed in Section 14.12, “InnoDB Startup Options and System Variables”. These variables
control many aspects of storage, memory use, and I/O patterns
for InnoDB
tables, and are especially
important now that InnoDB is
the default storage engine.
The value to be used by the following
INSERT
or
ALTER TABLE
statement when
inserting an AUTO_INCREMENT
value. This is
mainly used with the binary log.
Command-Line Format | --interactive_timeout=# | ||
System Variable | Name | interactive_timeout | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 28800 | ||
Min Value | 1 |
The number of seconds the server waits for activity on an
interactive connection before closing it. An interactive
client is defined as a client that uses the
CLIENT_INTERACTIVE
option to
mysql_real_connect()
. See also
wait_timeout
.
internal_tmp_disk_storage_engine
Introduced | 5.7.5 | ||
Command-Line Format | --internal_tmp_disk_storage_engine=# | ||
System Variable | Name | internal_tmp_disk_storage_engine | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (5.7.5) | Type | enumeration | |
Default | MYISAM | ||
Valid Values | MYISAM | ||
INNODB | |||
Permitted Values (>= 5.7.6) | Type | enumeration | |
Default | INNODB | ||
Valid Values | MYISAM | ||
INNODB |
The storage engine for on-disk internal temporary tables (see
Section 8.4.4, “Internal Temporary Table Use in MySQL”). Permitted values
are MYISAM
and INNODB
.
This variable was added in MySQL 5.7.5 with a default of
MYISAM
. In MySQL 5.7.6, the default value
was changed to INNODB
. With this change,
the optimizer uses the
InnoDB
storage engine by default for
on-disk internal temporary tables.
Under
internal_tmp_disk_storage_engine=INNODB
,
queries that generate temporary tables that exceed
InnoDB
row or column limits will return Row size
too large or Too many
columns errors. The workaround is to set
internal_tmp_disk_storage_engine
to MYISAM
.
Command-Line Format | --join_buffer_size=# | ||
System Variable | Name | join_buffer_size | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values (Windows) | Type | integer | |
Default | 262144 | ||
Min Value | 128 | ||
Max Value | 4294967295 | ||
Permitted Values (Other, 32-bit platforms) | Type | integer | |
Default | 262144 | ||
Min Value | 128 | ||
Max Value | 4294967295 | ||
Permitted Values (Other, 64-bit platforms) | Type | integer | |
Default | 262144 | ||
Min Value | 128 | ||
Max Value | 18446744073709547520 |
The minimum size of the buffer that is used for plain index
scans, range index scans, and joins that do not use indexes
and thus perform full table scans. Normally, the best way to
get fast joins is to add indexes. Increase the value of
join_buffer_size
to get a
faster full join when adding indexes is not possible. One join
buffer is allocated for each full join between two tables. For
a complex join between several tables for which indexes are
not used, multiple join buffers might be necessary.
Unless Batched Key Access (BKA) is used, there is no gain from setting the buffer larger than required to hold each matching row, and all joins allocate at least the minimum size, so use caution in setting this variable to a large value globally. It is better to keep the global setting small and change to a larger setting only in sessions that are doing large joins. Memory allocation time can cause substantial performance drops if the global size is larger than needed by most queries that use it.
When BKA is used, the value of
join_buffer_size
defines how
large the batch of keys is in each request to the storage
engine. The larger the buffer, the more sequential access will
be to the right hand table of a join operation, which can
significantly improve performance.
The default is 256KB. The maximum permissible setting for
join_buffer_size
is
4GB−1. Larger values are permitted for 64-bit platforms
(except 64-bit Windows, for which large values are truncated
to 4GB−1 with a warning).
For additional information about join buffering, see Section 8.2.1.10, “Nested-Loop Join Algorithms”. For information about Batched Key Access, see Section 8.2.1.14, “Block Nested-Loop and Batched Key Access Joins”.
Command-Line Format | --keep_files_on_create=# | ||
System Variable | Name | keep_files_on_create | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
If a MyISAM
table is created with no
DATA DIRECTORY
option, the
.MYD
file is created in the database
directory. By default, if MyISAM
finds an
existing .MYD
file in this case, it
overwrites it. The same applies to .MYI
files for tables created with no INDEX
DIRECTORY
option. To suppress this behavior, set the
keep_files_on_create
variable
to ON
(1), in which case
MyISAM
will not overwrite existing files
and returns an error instead. The default value is
OFF
(0).
If a MyISAM
table is created with a
DATA DIRECTORY
or INDEX
DIRECTORY
option and an existing
.MYD
or .MYI
file is
found, MyISAM always returns an error. It will not overwrite a
file in the specified directory.
Command-Line Format | --key_buffer_size=# | ||
System Variable | Name | key_buffer_size | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 8388608 | ||
Min Value | 8 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 8388608 | ||
Min Value | 8 | ||
Max Value | OS_PER_PROCESS_LIMIT |
Index blocks for MyISAM
tables are buffered
and are shared by all threads.
key_buffer_size
is the size
of the buffer used for index blocks. The key buffer is also
known as the key cache.
The maximum permissible setting for
key_buffer_size
is
4GB−1 on 32-bit platforms. Larger values are permitted
for 64-bit platforms. The effective maximum size might be
less, depending on your available physical RAM and per-process
RAM limits imposed by your operating system or hardware
platform. The value of this variable indicates the amount of
memory requested. Internally, the server allocates as much
memory as possible up to this amount, but the actual
allocation might be less.
You can increase the value to get better index handling for
all reads and multiple writes; on a system whose primary
function is to run MySQL using the
MyISAM
storage engine, 25% of the
machine's total memory is an acceptable value for this
variable. However, you should be aware that, if you make the
value too large (for example, more than 50% of the
machine's total memory), your system might start to page
and become extremely slow. This is because MySQL relies on the
operating system to perform file system caching for data
reads, so you must leave some room for the file system cache.
You should also consider the memory requirements of any other
storage engines that you may be using in addition to
MyISAM
.
For even more speed when writing many rows at the same time,
use LOCK TABLES
. See
Section 8.2.2.1, “Speed of INSERT Statements”.
You can check the performance of the key buffer by issuing a
SHOW STATUS
statement and
examining the
Key_read_requests
,
Key_reads
,
Key_write_requests
, and
Key_writes
status variables.
(See Section 13.7.5, “SHOW Syntax”.) The
Key_reads/Key_read_requests
ratio should
normally be less than 0.01. The
Key_writes/Key_write_requests
ratio is
usually near 1 if you are using mostly updates and deletes,
but might be much smaller if you tend to do updates that
affect many rows at the same time or if you are using the
DELAY_KEY_WRITE
table option.
The fraction of the key buffer in use can be determined using
key_buffer_size
in
conjunction with the
Key_blocks_unused
status
variable and the buffer block size, which is available from
the key_cache_block_size
system variable:
1 - ((Key_blocks_unused * key_cache_block_size) / key_buffer_size)
This value is an approximation because some space in the key buffer is allocated internally for administrative structures. Factors that influence the amount of overhead for these structures include block size and pointer size. As block size increases, the percentage of the key buffer lost to overhead tends to decrease. Larger blocks results in a smaller number of read operations (because more keys are obtained per read), but conversely an increase in reads of keys that are not examined (if not all keys in a block are relevant to a query).
It is possible to create multiple MyISAM
key caches. The size limit of 4GB applies to each cache
individually, not as a group. See
Section 8.10.2, “The MyISAM Key Cache”.
Command-Line Format | --key_cache_age_threshold=# | ||
System Variable | Name | key_cache_age_threshold | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 300 | ||
Min Value | 100 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 300 | ||
Min Value | 100 | ||
Max Value | 18446744073709551615 |
This value controls the demotion of buffers from the hot sublist of a key cache to the warm sublist. Lower values cause demotion to happen more quickly. The minimum value is 100. The default value is 300. See Section 8.10.2, “The MyISAM Key Cache”.
Command-Line Format | --key_cache_block_size=# | ||
System Variable | Name | key_cache_block_size | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 1024 | ||
Min Value | 512 | ||
Max Value | 16384 |
The size in bytes of blocks in the key cache. The default value is 1024. See Section 8.10.2, “The MyISAM Key Cache”.
Command-Line Format | --key_cache_division_limit=# | ||
System Variable | Name | key_cache_division_limit | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 100 | ||
Min Value | 1 | ||
Max Value | 100 |
The division point between the hot and warm sublists of the key cache buffer list. The value is the percentage of the buffer list to use for the warm sublist. Permissible values range from 1 to 100. The default value is 100. See Section 8.10.2, “The MyISAM Key Cache”.
Introduced | 5.7.11 | ||
Command-Line Format | --keyring_file_data=file_name | ||
System Variable | Name | keyring_file_data | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | file name | |
Default | platform specific |
The path name of the data file used for secure data storage by
the keyring_file
plugin. The file location
should be in a directory considered for use only by the
keyring_file
plugin. For example, do not
locate the file under the data directory.
Do not use the same keyring_file
data file
for multiple MySQL instances. Each instance should have its
own unique data file.
The default file name is keyring
, located
in a directory that is platform specific and depends on the
value of the INSTALL_LAYOUT
CMake option, as shown in the following
table. To specify the default directory for the file
explicitly if you are building from source, use the
INSTALL_MYSQLKEYRINGDIR
CMake option.
INSTALL_LAYOUT Value | Default keyring_file_data Value |
---|---|
DEB , RPM , SLES ,
SVR4 | /var/lib/mysql-keyring/keyring |
Otherwise | keyring/keyring under the
CMAKE_INSTALL_PREFIX
value |
If the value assigned to
keyring_file_data
specifies a
file that does not exist, the keyring_file
plugin attempts to create it during plugin initialization. If
necessary, the plugin also creates the directory in which the
file is located.
If you create the directory manually, it should have a
restrictive mode and be accessible only to the account used to
run the server. For example, on Unix and Unix-like systems, if
you set keyring_file_data
to
/usr/local/mysql/mysql-keyring/keyring
,
the following commands (executed as root
)
create the directory and set its mode and ownership:
shell>cd /usr/local/mysql
shell>mkdir mysql-keyring
shell>chmod 750 mysql-keyring
shell>chown mysql mysql-keyring
shell>chgrp mysql mysql-keyring
If the keyring_file
plugin cannot create or
access the file, it writes an error message to the error log.
If an attempted runtime assignment to
keyring_file_data
results in
an error, the variable value remains unchanged.
Once the keyring_file
plugin has created
the keyring_file
plugin data file and
started to use it, it is important not to remove the file.
For example, InnoDB
uses the file to
store the master key used to decrypt the data in tables that
use tablespace encryption; see
Section 14.5.10, “InnoDB Tablespace Encryption”. Loss of the
file will cause data in such tables to become inaccessible.
(It is permissible to rename or move the file, as long as
you change the value of
keyring_file_data
to
match.)
System Variable | Name | large_files_support | |
Variable Scope | Global | ||
Dynamic Variable | No |
Whether mysqld was compiled with options for large file support.
Command-Line Format | --large-pages | ||
System Variable | Name | large_pages | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Platform Specific | Linux | ||
Permitted Values (Linux) | Type | boolean | |
Default | FALSE |
Whether large page support is enabled (via the
--large-pages
option). See
Section 8.12.5.2, “Enabling Large Page Support”.
System Variable | Name | large_page_size | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values (Linux) | Type | integer | |
Default | 0 |
If large page support is enabled, this shows the size of memory pages. Large memory pages are supported only on Linux; on other platforms, the value of this variable is always 0. See Section 8.12.5.2, “Enabling Large Page Support”.
The value to be returned from
LAST_INSERT_ID()
. This is
stored in the binary log when you use
LAST_INSERT_ID()
in a statement
that updates a table. Setting this variable does not update
the value returned by the
mysql_insert_id()
C API
function.
Command-Line Format | --lc-messages=name | ||
System Variable | Name | lc_messages | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | en_US |
The 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_dir
to produce
the location for the error message file. See
Section 10.2, “Setting the Error Message Language”.
Command-Line Format | --lc-messages-dir=dir_name | ||
System Variable | Name | lc_messages_dir | |
Variable 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_messages
to produce the
location for the error message file. See
Section 10.2, “Setting the Error Message Language”.
System Variable | Name | lc_time_names | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string |
This variable specifies the locale that controls the language
used to display day and month names and abbreviations. This
variable affects the output from the
DATE_FORMAT()
,
DAYNAME()
and
MONTHNAME()
functions. Locale
names are POSIX-style values such as
'ja_JP'
or 'pt_BR'
. The
default value is 'en_US'
regardless of your
system's locale setting. For further information, see
Section 10.7, “MySQL Server Locale Support”.
System Variable | Name | license | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | string | |
Default | GPL |
The type of license the server has.
System Variable | Name | local_infile | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean |
Whether LOCAL
is supported for
LOAD DATA
INFILE
statements. If this variable is disabled,
clients cannot use LOCAL
in
LOAD DATA
statements. See
Section 6.1.6, “Security Issues with LOAD DATA LOCAL”.
Command-Line Format | --lock_wait_timeout=# | ||
System Variable | Name | lock_wait_timeout | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 31536000 | ||
Min Value | 1 | ||
Max Value | 31536000 |
This variable specifies the timeout in seconds for attempts to acquire metadata locks. The permissible values range from 1 to 31536000 (1 year). The default is 31536000.
This timeout applies to all statements that use metadata
locks. These include DML and DDL operations on tables, views,
stored procedures, and stored functions, as well as
LOCK TABLES
,
FLUSH TABLES WITH READ
LOCK
, and HANDLER
statements.
This timeout does not apply to implicit accesses to system
tables in the mysql
database, such as grant
tables modified by GRANT
or
REVOKE
statements or table
logging statements. The timeout does apply to system tables
accessed directly, such as with
SELECT
or
UPDATE
.
The timeout value applies separately for each metadata lock
attempt. A given statement can require more than one lock, so
it is possible for the statement to block for longer than the
lock_wait_timeout
value
before reporting a timeout error. When lock timeout occurs,
ER_LOCK_WAIT_TIMEOUT
is
reported.
lock_wait_timeout
does not
apply to delayed inserts, which always execute with a timeout
of 1 year. This is done to avoid unnecessary timeouts because
a session that issues a delayed insert receives no
notification of delayed insert timeouts.
System Variable | Name | locked_in_memory | |
Variable Scope | Global | ||
Dynamic Variable | No |
log_backward_compatible_user_definitions
Introduced | 5.7.6 | ||
Removed | 5.7.9 | ||
Command-Line Format | --log_backward_compatible_user_definitions[={OFF|ON}] | ||
System Variable | Name | log_backward_compatible_user_definitions | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Whether to log the
user_specification
part of
CREATE USER
,
ALTER USER
, and
GRANT
statements in
backward-compatible (pre-5.7.6) fashion:
By default, this variable is disabled. The server writes
user specifications as
.
user
IDENTIFIED WITH
auth_plugin
AS
'hash_string
'
When enabled, the server writes user specifications as
.
Enabling this variable ensures better compatibility for
cross-version replication.
user
IDENTIFIED BY
PASSWORD
'hash_string
'
This variable was removed in MySQL 5.7.9 and replaced by
log_builtin_as_identified_by_password
.
log_bin_trust_function_creators
Command-Line Format | --log-bin-trust-function-creators | ||
System Variable | Name | log_bin_trust_function_creators | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | FALSE |
This variable applies when binary logging is enabled. It
controls whether stored function creators can be trusted not
to create stored functions that will cause unsafe events to be
written to the binary log. If set to 0 (the default), users
are not permitted to create or alter stored functions unless
they have the SUPER
privilege
in addition to the CREATE
ROUTINE
or ALTER
ROUTINE
privilege. A setting of 0 also enforces the
restriction that a function must be declared with the
DETERMINISTIC
characteristic, or with the
READS SQL DATA
or NO SQL
characteristic. If the variable is set to 1, MySQL does not
enforce these restrictions on stored function creation. This
variable also applies to trigger creation. See
Section 20.7, “Binary Logging of Stored Programs”.
log_builtin_as_identified_by_password
Introduced | 5.7.9 | ||
Command-Line Format | --log_builtin_as_identified_by_password[={OFF|ON}] | ||
System Variable | Name | log_builtin_as_identified_by_password | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
This variable affects binary logging of user-management
statements. If enabled, binary logging for
CREATE USER
statements
involving built-in authentication plugins rewrites the
statements to include an IDENTIFIED BY
PASSWORD
clause, and SET
PASSWORD
statements are logged as
SET PASSWORD
statements, rather
than being rewritten to ALTER
USER
statements.
This variable was added in MySQL 5.7.9. It replaces the
log_backward_compatible_user_definitions
variable.
Command-Line Format | --log-error[=file_name] | ||
System Variable | Name | log_error | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | file name |
The location of the error log, or stderr
if
the server is writing error message to the standard error
output. See Section 5.2.2, “The Error Log”.
Introduced | 5.7.2 | ||
Command-Line Format | --log_error_verbosity=# | ||
System Variable | Name | log_error_verbosity | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 3 | ||
Min Value | 1 | ||
Max Value | 3 |
This variable controls verbosity of the server in writing error, warning, and note messages to the error log. The following table shows the permitted values. The default is 3.
Verbosity Value | Message Types Logged |
---|---|
1 | Errors only |
2 | Errors and warnings |
3 | Errors, warnings, and notes |
log_error_verbosity
was added
in MySQL 5.7.2. It is preferred over, and should be used
instead of, the older
log_warnings
system variable.
See the description of
log_warnings
for information
about how that variable relates to
log_error_verbosity
. In
particular, assigning a value to
log_warnings
assigns a value
to log_error_verbosity
and
vice versa.
Command-Line Format | --log-output=name | ||
System Variable | Name | log_output | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | set | |
Default | FILE | ||
Valid Values | TABLE | ||
FILE | |||
NONE |
The destination for general query log and slow query log
output. The value can be a comma-separated list of one or more
of the words TABLE
(log to tables),
FILE
(log to files), or
NONE
(do not log to tables or files). The
default value is FILE
.
NONE
, if present, takes precedence over any
other specifiers. If the value is NONE
log
entries are not written even if the logs are enabled. If the
logs are not enabled, no logging occurs even if the value of
log_output
is not
NONE
. For more information, see
Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”.
Command-Line Format | --log-queries-not-using-indexes | ||
System Variable | Name | log_queries_not_using_indexes | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Whether queries that do not use indexes are logged to the slow query log. See Section 5.2.5, “The Slow Query Log”.
Introduced | 5.7.5 | ||
Command-Line Format | --log_syslog[={0|1}] | ||
System Variable | Name | log_syslog | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (Unix) | Type | boolean | |
Default | OFF | ||
Permitted Values (Windows) | Type | boolean | |
Default | ON |
Whether to write error log output to syslog
(on Unix and Unix-like systems) or Event Log (on Windows). The
default value is platform specific:
On Unix and Unix-like systems, syslog
output is disabled by default.
On Windows, Event Log output is enabled by default, which is consistent with older MySQL versions.
Regardless of the default,
log_syslog
can be set
explicitly to control output on any supported platform.
syslog
output control is orthogonal to
sending error output to a file or (on Windows) to the console.
Error output can be directed to the latter destination in
addition to or instead of syslog
as
desired.
Introduced | 5.7.5 | ||
Command-Line Format | --log_syslog_facility=value | ||
System Variable | Name | log_syslog_facility | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | daemon |
The facility for error log output written to
syslog
(what type of program is sending the
message). This variable has no effect unless the
log_syslog
system variable is
enabled.
The permitted values can vary per operating system; consult
your system syslog
documentation.
This variable does not exist on Windows.
Introduced | 5.7.5 | ||
Command-Line Format | --log_syslog_include_pid[={0|1}] | ||
System Variable | Name | log_syslog_include_pid | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | ON |
Whether to include the server process ID in each line of error
log output written to syslog
. This variable
has no effect unless the
log_syslog
system variable is
enabled.
This variable does not exist on Windows.
Introduced | 5.7.5 | ||
Command-Line Format | --log_syslog_tag=value | ||
System Variable | Name | log_syslog_tag | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | string | |
Default | empty string |
The tag to be added to the server identifier in error log
output written to syslog
. This variable has
no effect unless the
log_syslog
system variable is
enabled.
By default, the server identifier is mysqld
with no tag. If a tag of tag_val
is
specified, it is appended to the server identifier with a
leading hyphen, resulting in an identifier of
mysqld-
.
tag_val
On Windows, to use a tag that does not already exist, the server must be run from an account with Administrator privileges, to permit creation of a registry entry for the tag. Elevated privileges are not required if the tag already exists.
Introduced | 5.7.2 | ||
Command-Line Format | --log_timestamps=# | ||
System Variable | Name | log_timestamps | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | enumeration | |
Default | UTC | ||
Valid Values | UTC | ||
SYSTEM |
This variable controls the timestamp time zone of error log
messages, and of general query log and slow query log messages
written to files. It does not affect the time zone of general
query log and slow query log messages written to tables
(mysql.general_log
,
mysql.slow_log
). Rows retrieved from those
tables can be converted from the local system time zone to any
desired time zone with
CONVERT_TZ()
or by setting the
session time_zone
system
variable.
Permitted log_timestamps
values are UTC
(the default) and
SYSTEM
(local system time zone).
Timestamps are written using ISO 8601 / RFC 3339 format:
YYYY-MM-DDThh:mm:ss.uuuuuu
plus a tail
value of Z
signifying Zulu time (UTC) or
±hh:mm
(an offset from UTC).
This variable was added in MySQL 5.7.2. Before 5.7.2,
timestamps in log messages were written using the local system
time zone by default, not UTC
. If you want
the previous log message time zone default, set
log_timestamps=SYSTEM
.
log_throttle_queries_not_using_indexes
System Variable | Name | log_throttle_queries_not_using_indexes | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 0 |
If
log_queries_not_using_indexes
is enabled, the
log_throttle_queries_not_using_indexes
variable limits the number of such queries per minute that can
be written to the slow query log. A value of 0 (the default)
means “no limit”. For more information, see
Section 5.2.5, “The Slow Query Log”.
Introduced | 5.7.1 | ||
System Variable | Name | log_slow_admin_statements | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | OFF |
Include 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
, and
REPAIR TABLE
.
Deprecated | 5.7.2 | ||
Command-Line Format | --log-warnings[=#] | ||
System Variable | Name | log_warnings | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms, <= 5.7.1) | Type | integer | |
Default | 1 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (32-bit platforms, >= 5.7.2) | Type | integer | |
Default | 2 | ||
Min Value | 0 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms, <= 5.7.1) | Type | integer | |
Default | 1 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 | ||
Permitted Values (64-bit platforms, >= 5.7.2) | Type | integer | |
Default | 2 | ||
Min Value | 0 | ||
Max Value | 18446744073709551615 |
Whether to produce additional warning messages to the error log. This variable is enabled by default (the default is 1 before MySQL 5.7.2, 2 as of 5.7.2). To disable it, set it to 0. 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”.
Enabling this option by setting it greater than 0 is recommended, if you use replication, to get more information about what is happening, such as messages about network failures and reconnections. If the value is greater than 1, aborted connections are written to the error log, and access-denied errors for new connection attempts are written.
If a slave server is started with
log_warnings
enabled, the
slave prints messages to the error log to provide information
about its status, such as the binary log and relay log
coordinates where it starts its job, when it is switching to
another relay log, when it reconnects after a disconnect, and
so forth.
As of MySQL 5.7.2, information items previously governed by
log_warnings
are governed by
log_error_verbosity
, which is
preferred over, and should be used instead of, the older
log_warnings
system variable.
(The log_warnings
system
variable and --log-warnings
command-line option are deprecated and will be removed in a
future MySQL release.)
Assigning a value to
log_warnings
assigns a value
to log_error_verbosity
and
vice versa. The variables are related as follows:
Suppression of all
log_warnings
items,
achieved with
log_warnings=0
, is
achieved with
log_error_verbosity=1
(errors only).
Items printed for
log_warnings=1
or higher
count as warnings and are printed for
log_error_verbosity=2
or
higher.
Items printed for
log_warnings=2
count as
notes and are printed for
log_error_verbosity=3
.
As of MySQL 5.7.2, the default log level is controlled by
log_error_verbosity
, which
has a default of 3. In addition, the default for
log_warnings
changes from 1
to 2, which corresponds to
log_error_verbosity=3
. To
achieve a logging level similar to the previous default, set
log_error_verbosity=2
.
In MySQL 5.7.2 and higher, use of
log_warnings
is still
permitted but maps onto use of
log_error_verbosity
as
follows:
Setting log_warnings=0
is
equivalent to
log_error_verbosity=1
(errors only).
Setting log_warnings=1
is
equivalent to
log_error_verbosity=2
(errors, warnings).
Setting log_warnings=2
(or higher) is equivalent to
log_error_verbosity=3
(errors, warnings, notes), and the server sets
log_warnings
to 2 if a
larger value is specified.
Command-Line Format | --long_query_time=# | ||
System Variable | Name | long_query_time | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | numeric | |
Default | 10 | ||
Min Value | 0 |
If a query takes longer than this many seconds, the server
increments the Slow_queries
status variable. If the slow query log is enabled, the query
is logged to the slow query log file. This value is measured
in real time, not CPU time, so a query that is under the
threshold on a lightly loaded system might be above the
threshold on a heavily loaded one. The minimum and default
values of long_query_time
are
0 and 10, respectively. The value can be specified to a
resolution of microseconds. For logging to a file, times are
written including the microseconds part. For logging to
tables, only integer times are written; the microseconds part
is ignored. See Section 5.2.5, “The Slow Query Log”.
Command-Line Format | --low-priority-updates | ||
System Variable | Name | low_priority_updates | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | boolean | |
Default | FALSE |
If set to 1
, all
INSERT
,
UPDATE
,
DELETE
, and LOCK TABLE
WRITE
statements wait until there is no pending
SELECT
or LOCK TABLE
READ
on the affected table. This affects only
storage engines that use only table-level locking (such as
MyISAM
, MEMORY
, and
MERGE
).
System Variable | Name | lower_case_file_system | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | boolean |
This variable describes the case sensitivity of file names on
the file system where the data directory is located.
OFF
means file names are case sensitive,
ON
means they are not case sensitive. This
variable is read only because it reflects a file system
attribute and setting it would have no effect on the file
system.
Command-Line Format | --lower_case_table_names[=#] | ||
System Variable | Name | lower_case_table_names | |
Variable Scope | Global | ||
Dynamic Variable | No | ||
Permitted Values | Type | integer | |
Default | 0 | ||
Min Value | 0 | ||
Max Value | 2 |
If set to 0, table names are stored as specified and comparisons are case sensitive. If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase. This option also applies to database names and table aliases. For additional information, see Section 9.2.2, “Identifier Case Sensitivity”.
On Windows the default value is 1. On OS X, the default value is 2.
You should not set
lower_case_table_names
to 0
if you are running MySQL on a system where the data directory
resides on a case-insensitive file system (such as on Windows
or OS X). It is an unsupported combination that could result
in a hang condition when running an INSERT INTO ...
SELECT ... FROM
operation with the wrong tbl_name
tbl_name
letter case. With MyISAM
, accessing table
names using different letter cases could cause index
corruption.
As of MySQL 5.7.9, an error message is printed and the server
exits if you attempt to start the server with
--lower_case_table_names=0
on
a case-insensitive file system.
If you are using InnoDB
tables, you should
set this variable to 1 on all platforms to force names to be
converted to lowercase.
The setting of this variable in MySQL 5.7 affects the behavior of replication filtering options with regard to case sensitivity. (Bug #51639) See Section 17.2.5, “How Servers Evaluate Replication Filtering Rules”, for more information.
Command-Line Format | --max_allowed_packet=# | ||
System Variable | Name | max_allowed_packet | |
Variable Scope | Global, Session | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 4194304 | ||
Min Value | 1024 | ||
Max Value | 1073741824 |
The maximum size of one packet or any generated/intermediate
string, or any parameter sent by the
mysql_stmt_send_long_data()
C
API function. The default is 4MB.
The packet message buffer is initialized to
net_buffer_length
bytes, but
can grow up to
max_allowed_packet
bytes when
needed. This value by default is small, to catch large
(possibly incorrect) packets.
You must increase this value if you are using large
BLOB
columns or long strings.
It should be as big as the largest
BLOB
you want to use. The
protocol limit for
max_allowed_packet
is 1GB.
The value should be a multiple of 1024; nonmultiples are
rounded down to the nearest multiple.
When you change the message buffer size by changing the value
of the max_allowed_packet
variable, you should also change the buffer size on the client
side if your client program permits it. The default
max_allowed_packet
value
built in to the client library is 1GB, but individual client
programs might override this. For example,
mysql and mysqldump have
defaults of 16MB and 24MB, respectively. They also enable you
to change the client-side value by setting
max_allowed_packet
on the
command line or in an option file.
The session value of this variable is read only. The client
can receive up to as many bytes as the session value. However,
the server will not send to the client more bytes than the
current global
max_allowed_packet
value.
(The global value could be less than the session value if the
global value is changed after the client connects.)
Command-Line Format | --max_connect_errors=# | ||
System Variable | Name | max_connect_errors | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms) | Type | integer | |
Default | 100 | ||
Min Value | 1 | ||
Max Value | 4294967295 | ||
Permitted Values (64-bit platforms) | Type | integer | |
Default | 100 | ||
Min Value | 1 | ||
Max Value | 18446744073709551615 |
If more than this many successive connection requests from a
host are interrupted without a successful connection, the
server blocks that host from further connections. You can
unblock blocked hosts by flushing the host cache. To do so,
issue a FLUSH
HOSTS
statement or execute a mysqladmin
flush-hosts command. If a connection is established
successfully within fewer than
max_connect_errors
attempts
after a previous connection was interrupted, the error count
for the host is cleared to zero. However, once a host is
blocked, flushing the host cache is the only way to unblock
it. The default is 100.
Command-Line Format | --max_connections=# | ||
System Variable | Name | max_connections | |
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer | |
Default | 151 | ||
Min Value | 1 | ||
Max Value | 100000 |
The maximum permitted number of simultaneous client connections. By default, this is 151. See Section B.5.2.7, “Too many connections”, for more information.
Increasing this value increases the number of file descriptors that