MySQL 5.6 Reference Manual Including MySQL NDB Cluster 7.3-7.4 Reference Guide
When you start the mysqld server, you can specify program options using any of the methods described in Section 4.2.2, “Specifying Program Options”. The most common methods are to provide options in an option file or on the command line. However, in most cases it is desirable to make sure that the server uses the same options each time it runs. The best way to ensure this is to list them in an option file. See Section 4.2.2.2, “Using Option Files”. That section also describes option file format and syntax.
mysqld reads options from the
[mysqld]
and [server]
groups. mysqld_safe reads options from the
[mysqld]
, [server]
,
[mysqld_safe]
, and
[safe_mysqld]
groups.
mysql.server reads options from the
[mysqld]
and [mysql.server]
groups.
An embedded MySQL server usually reads options from the
[server]
, [embedded]
, and
[
groups, where xxxxx
_SERVER]xxxxx
is the name of the
application into which the server is embedded.
mysqld accepts many command options. For a brief summary, execute this command:
mysqld --help
To see the full list, use this command:
mysqld --verbose --help
Some of the items in the list are actually system variables that
can be set at server startup. These can be displayed at runtime
using the SHOW VARIABLES
statement.
Some items displayed by the preceding mysqld
command do not appear in SHOW
VARIABLES
output; this is because they are options only
and not system variables.
The following list shows some of the most common server options. Additional options are described in other sections:
Options that affect security: See Section 6.1.4, “Security-Related mysqld Options and Variables”.
SSL-related options: See Command Options for Encrypted Connections.
Binary log control options: See Section 5.4.4, “The Binary Log”.
Replication-related options: See Section 17.1.4, “Replication and Binary Logging Options and Variables”.
Options for loading plugins such as pluggable storage engines: See Section 5.5.1, “Installing and Uninstalling Plugins”.
Options specific to particular storage engines: See Section 14.14, “InnoDB Startup Options and System Variables” and Section 15.2.1, “MyISAM Startup Options”.
Some options control the size of buffers or caches. For a given buffer, the server might need to allocate internal data structures. These structures typically are allocated from the total memory allocated to the buffer, and the amount of space required might be platform dependent. This means that when you assign a value to an option that controls a buffer size, the amount of space actually available might differ from the value assigned. In some cases, the amount might be less than the value assigned. It is also possible that the server adjusts a value upward. For example, if you assign a value of 0 to an option for which the minimal value is 1024, the server sets the value to 1024.
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.
Some options take file name values. Unless otherwise specified,
the default file location is the data directory if the value is a
relative path name. To specify the location explicitly, use an
absolute path name. Suppose that the data directory is
/var/mysql/data
. If a file-valued option is
given as a relative path name, it is located under
/var/mysql/data
. If the value is an absolute
path name, its location is as given by the path name.
You can also set the values of server system variables at server
startup by using variable names as options. To assign a value to a
server system variable, use an option of the form
--
.
For example, var_name
=value
--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.
To restrict the maximum value to which a system variable can be
set at runtime with the
SET
statement, specify this maximum by using an option of the form
--maximum-
at server startup.
var_name
=value
You can change the values of most system variables at runtime with
the SET
statement. See Section 13.7.4.1, “SET Syntax for Variable Assignment”.
Section 5.1.7, “Server System Variables”, provides a full description for all variables, and additional information for setting them at server startup and runtime. For information on changing system variables, see Section 5.1.1, “Configuring the Server”.
--help
, -?
Command-Line Format | --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[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
This option controls whether loadable functions that have only
an xxx
symbol for the main function can be
loaded. By default, the option is off and only loadable
functions that have at least one auxiliary symbol can be
loaded; this prevents attempts at loading functions from
shared object files other than those containing legitimate
functions. See Loadable Function Security Precautions.
Command-Line Format | --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.7, “MySQL Standards Compliance”, and
Section 5.1.10, “Server SQL Modes”.
--basedir=
,
dir_name
-b
dir_name
Command-Line Format | --basedir=dir_name |
---|---|
System Variable | basedir |
Scope | Global |
Dynamic | No |
Type | Directory name |
Default Value | configuration-dependent default |
The path to the MySQL installation directory. This option sets
the basedir
system variable.
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.
Replication and global transaction identifiers are automatically disabled whenever this option is used (Bug #13992602). 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
system
variable. For more information, see the description of that
variable.
--character-set-client-handshake
Command-Line Format | --character-set-client-handshake[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | ON |
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.
--chroot=
,
dir_name
-r
dir_name
Command-Line Format | --chroot=dir_name |
---|---|
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
and
SELECT ... INTO
OUTFILE
.
Command-Line Format | --console |
---|---|
Platform Specific | Windows |
(Windows only.) Write error log messages to
stderr
and stdout
(the
console). mysqld does not close the console
window if this option is used.
--log-error
takes precedence
over --console
if both are
given.
Command-Line Format | --core-file[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | 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 macOS, 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.
--datadir=
,
dir_name
-h
dir_name
Command-Line Format | --datadir=dir_name |
---|---|
System Variable | datadir |
Scope | Global |
Dynamic | No |
Type | Directory name |
The path to the MySQL server data directory. This option sets
the datadir
system variable.
See the description of that variable.
--debug[=
,
debug_options
]-# [
debug_options
]
Command-Line Format | --debug[=debug_options] |
---|---|
System Variable | debug |
Scope | Global, Session |
Dynamic | Yes |
Type | String |
Default Value (Unix) | d:t:i:o,/tmp/mysqld.trace |
Default Value (Windows) | 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 5.8.3, “The DBUG Package”.
Command-Line Format | --debug-sync-timeout[=#] |
---|---|
Type | Integer |
Controls whether the Debug Sync facility for testing and
debugging is enabled. Use of Debug Sync requires that MySQL be
configured with the
-DENABLE_DEBUG_SYNC=1
CMake option (see
Section 2.9.7, “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
Command-Line Format | --default-authentication-plugin=plugin_name |
---|---|
Type | Enumeration |
Default Value | mysql_native_password |
Valid Values |
|
This option sets the default authentication plugin. These values are permitted:
mysql_native_password
: Use MySQL native
passwords; see
Section 6.4.1.1, “Native Pluggable Authentication”.
sha256_password
: Use SHA-256 passwords;
see Section 6.4.1.4, “SHA-256 Pluggable Authentication”.
Prior to MySQL 5.6.17, if you use this option to change the
default authentication plugin to a value other than
mysql_native_password
, clients older than
MySQL 5.5.7 cannot connect because they do not understand
the resulting change to the authentication protocol.
In MySQL 5.6, there is no server system variable
that corresponds to the
--default-authentication-plugin
option; to read the value set for this option, you
must check the running MySQL Server process to see what
options, if any, were employed when invoking
mysqld (on Linux systems, you can do this
with ps ax | grep mysqld
or similar), and
possibly the server options file as well. This is a known
issue which is resolved in MySQL 5.7. (Bug #68858, Bug
#16595944)
The
--default-authentication-plugin
value 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 explicitly specify an authentication plugin.
The old_passwords
system
variable affects password hashing for accounts that use
the mysql_native_password
or
sha256_password
authentication plugin.
If the default authentication plugin is one of those
plugins, the server sets
old_passwords
at startup
to the value required by the plugin password hashing
method.
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 as required by that plugin:
CREATE USER ... IDENTIFIED BY 'cleartext password
'; GRANT ... IDENTIFIED BY 'cleartext password
';
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 hash, if the password hash has the format required by the plugin:
CREATE USER ... IDENTIFIED BY PASSWORD 'encrypted password
'; GRANT ... IDENTIFIED BY PASSWORD 'encrypted password
';
If the password hash is not in the format required by the default authentication plugin, the statement fails.
Command-Line Format | --default-time-zone=name |
---|---|
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.
The system_time_zone
variable
differs from time_zone
.
Although they might have the same value, the latter variable
is used to initialize the time zone for each client that
connects. See Section 5.1.13, “MySQL Server Time Zone Support”.
--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. If
file_name
is not an absolute path
name, it is interpreted relative to the current directory.
This must be the first option on the command line if it is
used.
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Read only the given option file. If the file does not exist or
is otherwise inaccessible, an error occurs. If
file_name
is not an absolute path
name, it is interpreted relative to the current directory.
This must be the first option on the command line if it is
used, except that if the server is started with the
--defaults-file
and
--install
(or
--install-manual
) options,
--install
(or
--install-manual
) must be
first.
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Read not only the usual option groups, but also groups with
the usual names and a suffix of
str
. For example,
mysqld normally reads the
[mysqld]
group. If this option is given as
--defaults-group-suffix=_other
,
mysqld also reads the
[mysqld_other]
group.
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.
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.
--exit-info[=
,
flags
]-T [
flags
]
Command-Line Format | --exit-info[=flags] |
---|---|
Type | Integer |
This is a bitmask of different flags that you can use for debugging the mysqld server. Do not use this option unless you know exactly what it does!
Command-Line Format | --external-locking[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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[={OFF|ON}] |
---|---|
System Variable | flush |
Scope | Global |
Dynamic | Yes |
Type | Boolean |
Default Value | 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.3.3.3, “What to Do If MySQL Keeps Crashing”.
If --flush
is specified, the
value of flush_time
does
not matter and changes to
flush_time
have no effect
on flush behavior.
Command-Line Format | --gdb[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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 5.8.1.4, “Debugging mysqld under gdb”.
Command-Line Format | --ignore-db-dir=dir_name |
---|---|
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.
--innodb-
xxx
Set an option for the InnoDB
storage
engine. The InnoDB
options are listed in
Section 14.14, “InnoDB Startup Options and System Variables”.
Command-Line Format | --install [service_name] |
---|---|
Platform Specific | Windows |
(Windows only) Install the server as a Windows service that
starts automatically during Windows startup. The default
service name is MySQL
if no
service_name
value is given. For
more information, see Section 2.3.4.7, “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.4.7, “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
Command-Line Format | --language=name |
---|---|
Deprecated | Yes; use lc-messages-dir instead |
System Variable | language |
Scope | Global |
Dynamic | No |
Type | Directory name |
Default Value | /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.12, “Setting the Error Message Language”.
--lc-messages-dir
and
--lc-messages
should be used
rather than --language
, which
is deprecated and handled as a synonym for
--lc-messages-dir
. Expect the
--language
option to be removed
in a future MySQL release.
Command-Line Format | --large-pages[={OFF|ON}] |
---|---|
System Variable | large_pages |
Scope | Global |
Dynamic | No |
Platform Specific | Linux |
Type | Boolean |
Default Value | OFF |
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.4.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 | lc_messages |
Scope | Global, Session |
Dynamic | Yes |
Type | String |
Default Value | 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.12, “Setting the Error Message Language”.
Command-Line Format | --lc-messages-dir=dir_name |
---|---|
System Variable | lc_messages_dir |
Scope | Global |
Dynamic | No |
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.12, “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. If both
--defaults-file
and
--local-service
are given following the
service name, they can be in any order. See
Section 2.3.4.7, “Starting MySQL as a Windows Service”.
Command-Line Format | --log-error[=file_name] |
---|---|
System Variable | log_error |
Scope | Global |
Dynamic | No |
Type | File name |
Write the error log and startup messages to this file. See Section 5.4.2, “The Error Log”.
If the option names no file, the error log file name on Unix
and Unix-like systems is
in the data directory. The file name on Windows is the same,
unless the host_name
.err--pid-file
option is
specified. In that case, the file name is the PID file base
name with a suffix of .err
in the data
directory.
If the option names a file, the error log file has that name
(with an .err
suffix added if the name
has no suffix), located under the data directory unless an
absolute path name is given to specify a different location.
On Windows, --log-error
takes
precedence over --console
if
both are given.
Command-Line Format | --log-isam[=file_name] |
---|---|
Type | File name |
Log all MyISAM
changes to this file (used
only when debugging MyISAM
).
Command-Line Format | --log-raw[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | 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.
Command-Line Format | --log-short-format[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
Log less information to the slow query log, if it has been activated.
Command-Line Format | --log-slow-admin-statements[={OFF|ON}] (5.6.10) |
---|---|
Removed | 5.6.11 |
Type | Boolean |
Default Value | 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.6.11 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 |
---|---|
Type | File name |
Default Value | 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=# |
---|---|
Type | Integer |
Default Value | 24576 |
Maximum Value (64-bit platforms) | 18446744073709551615 |
Maximum Value (32-bit platforms) | 4294967295 |
The size in bytes of the memory-mapped transaction coordinator log. The default size is 24KB.
--log-warnings[=
,
level
]-W [
level
]
Command-Line Format | --log-warnings[=#] |
---|---|
System Variable | log_warnings |
Scope | Global |
Dynamic | Yes |
Type | Integer |
Default Value | 1 |
Minimum Value | 0 |
Maximum Value (64-bit platforms) | 18446744073709551615 |
Maximum Value (32-bit platforms) | 4294967295 |
Print out warnings such as Aborted
connection...
to the error log. This option is
enabled (1) by default. To disable it, use
--log-warnings=0
. Specifying
the option without a level
value
increments the current value by 1. Enabling this option by
setting it greater than 0 is recommended, for example, if you
use replication (you 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. See
Section B.3.2.10, “Communication Errors and Aborted Connections”.
If a replica server was started with
--log-warnings
enabled, the
replica 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. The server logs messages about statements that
are unsafe for statement-based logging if
--log-warnings
is greater than
0.
Command-Line Format | --memlock[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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
higher 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:
$> 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.4.2, “Enabling Large Page Support”.
You must not use this option on a system that does not
support the mlockall()
system call; if
you do so, mysqld is very likely to exit
as soon as you try to start it.
Command-Line Format | --myisam-block-size=# |
---|---|
Type | Integer |
Default Value | 1024 |
Minimum Value | 1024 |
Maximum Value | 16384 |
The block size to be used for MyISAM
index
pages.
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. This must be the first option on
the command line if it is used.
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Command-Line Format | --old-style-user-limits[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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.2.13, “Setting Account Resource Limits”.
Command-Line Format | --partition[={OFF|ON}] |
---|---|
Disabled by | skip-partition |
Type | Boolean |
Default Value | 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.14, “Performance Schema Command Options”.
Command-Line Format | --plugin-load=plugin_list |
---|---|
System Variable | plugin_load |
Scope | Global |
Dynamic | No |
Type | String |
This option tells the server to load the named plugins at
startup. If multiple
--plugin-load
options are
given, only the last one applies. Additional plugins to load
may be specified using
--plugin-load-add
options.
The option value is a semicolon-separated list of
plugin_library
and
name
=
plugin_library
values. Each plugin_library
is the
name of a library file that contains plugin code, and each
name
is the name of a plugin to
load. If a plugin library is named without any preceding
plugin name, the server loads all plugins in the library. With
a preceding plugin name, the server loads only the named
plugin from the libary. 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
are contained in the plugin library
files myplug1.so
and
myplug2.so
, use this option to perform an
early plugin load:
mysqld --plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"
Quotes surround the argument value because otherwise some
command interpreters interpret semicolon
(;
) as a special character. (For example,
Unix shells treat it as a command terminator.)
Each named plugin is loaded for a single invocation of
mysqld only. After a restart, the plugin is
not loaded unless --plugin-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.
During the normal startup sequence, 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,
plugins registered in the mysql.plugins
table are not loaded and are unavailable.
--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.5.1, “Installing and Uninstalling Plugins”.
Command-Line Format | --plugin-load-add=plugin_list |
---|---|
System Variable | plugin_load_add |
Scope | Global |
Dynamic | No |
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.5.1, “Installing and Uninstalling Plugins”.
Specifies an option that pertains to a server plugin. For
example, many storage engines can be built as plugins, and for
such engines, options for them can be specified with a
--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.2.4, “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.
--port=
,
port_num
-P
port_num
Command-Line Format | --port=port_num |
---|---|
System Variable | port |
Scope | Global |
Dynamic | No |
Type | Integer |
Default Value | 3306 |
Minimum Value | 0 |
Maximum 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
operating system user. Setting this
option to 0 causes the default value to be used.
Command-Line Format | --port-open-timeout=# |
---|---|
Type | Integer |
Default Value | 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. This must be the first option on the command
line if it is used, except that it may be used immediately
after --defaults-file
or
--defaults-extra-file
.
For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”.
Command-Line Format | --remove [service_name] |
---|---|
Platform Specific | Windows |
(Windows only) Remove a MySQL Windows service. The default
service name is MySQL
if no
service_name
value is given. For
more information, see Section 2.3.4.7, “Starting MySQL as a Windows Service”.
Command-Line Format | --safe-user-create[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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
system 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.
Command-Line Format | --skip-grant-tables[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
This option affects the server startup sequence:
--skip-grant-tables
causes
the server not to read the grant tables in the
mysql
system database, and thus to
start without using the privilege system at all. This
gives anyone with access to the server
unrestricted access to all databases.
To cause a server started with
--skip-grant-tables
to load
the grant tables at runtime, perform a privilege-flushing
operation, which can be done in these ways:
Issue a MySQL FLUSH
PRIVILEGES
statement after connecting to the
server.
Execute a mysqladmin flush-privileges or mysqladmin reload command from the command line.
Privilege flushing might also occur implicitly as a result of other actions performed after startup, thus causing the server to start using the grant tables. For example, mysql_upgrade flushes the privileges during the upgrade procedure.
--skip-grant-tables
causes
the server not to load certain other objects registered in
the mysql
system database:
Plugins installed using INSTALL
PLUGIN
and registered in the
mysql.plugin
system table.
To cause plugins to be loaded even when using
--skip-grant-tables
,
use the --plugin-load
or --plugin-load-add
option.
Scheduled events installed using
CREATE EVENT
and
registered in the mysql.event
system table.
Loadable functions installed using
CREATE
FUNCTION
and registered in the
mysql.func
system table.
Command-Line Format | --skip-host-cache |
---|
Disable use of the internal host cache for faster name-to-IP resolution. With the cache disabled, the server performs a DNS lookup every time a client connects.
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.
Starting the server with
--skip-host-cache
does not
prevent runtime 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.
For more information about how the host cache works, see Section 5.1.11.2, “DNS Lookups and the Host Cache”.
Disable the InnoDB
storage engine. In this
case, because the default storage engine is
InnoDB
, the server cannot 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.6.21, the
--skip-innodb
option is deprecated. Its use results in a warning. Expect
this option to be removed in a future MySQL release.
Command-Line Format | --skip-new |
---|
This option disables (what used to be considered) new,
possibly unsafe behaviors. It results in these settings:
delay_key_write=OFF
,
concurrent_insert=NEVER
,
automatic_sp_privileges=OFF
.
It also causes OPTIMIZE TABLE
to be mapped to ALTER TABLE
for
storage engines for which OPTIMIZE
TABLE
is not supported.
Command-Line Format |
|
---|
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
.par
files associated with partitioned
tables in such cases. For this reason, you should avoid
dropping partitioned tables with partitioning disabled, or
take action to remove the orphaned .par
files manually.
Command-Line Format | --skip-show-database |
---|---|
System Variable | skip_show_database |
Scope | Global |
Dynamic | No |
Type | Boolean |
Default Value | OFF |
This option sets the
skip_show_database
system
variable that controls who is permitted to use the
SHOW DATABASES
statement. See
Section 5.1.7, “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 5.8, “Debugging MySQL”.
Command-Line Format | --slow-start-timeout=# |
---|---|
Type | Integer |
Default Value | 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 | socket |
Scope | Global |
Dynamic | No |
Type | String |
Default Value (Windows) | MySQL |
Default Value (Other) | /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 | sql_mode |
Scope | Global, Session |
Dynamic | Yes |
Type | Set |
Default Value | NO_ENGINE_SUBSTITUTION |
Valid Values |
|
Set the SQL mode. The default is
NO_ENGINE_SUBSTITUTION
. See
Section 5.1.10, “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.3, “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 | --ssl[={OFF|ON}] |
---|---|
Disabled by | skip-ssl |
Type | Boolean |
Default Value | OFF |
This option specifies that the server permits but does not
require encrypted connections.
--ssl
may be implied by setting
ssl_
system
variables, as indicated in the descriptions for those
variables.
xxx
--ssl
can be specified in
negated form as
--skip-ssl
or a
synonym (--ssl=OFF
,
--disable-ssl
).
In this case, the option specifies that the server does
not permit encrypted connections,
regardless of the settings of the
ssl_
system
variables.
xxx
For more information about configuring whether the server
permits clients to connect using SSL and indicating where to
find SSL keys and certificates, see
Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”. Consider
setting at least the ssl_cert
and ssl_key
system variables
on the server side and the
--ssl-ca
(or
--ssl-capath
) option on the
client side.
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[={OFF|ON}] |
---|---|
Platform Specific | Solaris |
Type | Boolean |
Default Value | OFF |
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[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | ON |
Enable or disable symbolic link support. This option has different effects on Windows and Unix:
On Windows, enabling symbolic links enables you to
establish a symbolic link to a database directory by
creating a
file that contains the path to the real directory. See
Section 8.12.3.3, “Using Symbolic Links for Databases on Windows”.
db_name
.sym
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
option 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.3.2, “Using Symbolic Links for MyISAM Tables on Unix”.
Command-Line Format | --sysdate-is-now[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | OFF |
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 a synonym 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.7, “Server System Variables”.
--tc-heuristic-recover={COMMIT|ROLLBACK}
Command-Line Format | --tc-heuristic-recover=name |
---|---|
Type | Enumeration |
Default Value | OFF |
Valid Values |
|
The decision to use in a manual heuristic recovery.
If a --tc-heuristic-recover
option is
specified, the server exits regardless of whether manual
heuristic recovery is successful.
On systems with more than one storage engine capable of
two-phase commit, the ROLLBACK
option is
not safe and causes recovery to halt with the following error:
[ERROR] --tc-heuristic-recover rollback strategy is not safe on systems with more than one 2-phase-commit-capable storage engine. Aborting crash recovery.
Command-Line Format | --temp-pool[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value (Linux) | ON |
Default Value (Other) | OFF |
This option is ignored except on Linux. On Linux, it 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.
Command-Line Format | --transaction-isolation=name |
---|---|
Type | Enumeration |
Default Value | REPEATABLE-READ |
Valid Values |
|
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 Statement”.
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[={OFF|ON}] |
---|---|
Type | Boolean |
Default Value | 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 Statement”.
--tmpdir=
,
dir_name
-t
dir_name
Command-Line Format | --tmpdir=dir_name |
---|---|
System Variable | tmpdir |
Scope | Global |
Dynamic | No |
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.
--tmpdir
can be a non-permanent
location, such as a directory on a memory-based file system or
a directory that is cleared when the server host restarts. If
the MySQL server is acting as a replica, and you are using a
non-permanent location for
--tmpdir
, consider setting a
different temporary directory for the replica using the
slave_load_tmpdir
system
variable. For a replica, the temporary files used to replicate
LOAD DATA
statements are stored
in this directory, so with a permanent location they can
survive machine restarts, although replication can now
continue after a restart if the temporary files have been
removed.
For more information about the storage location of temporary files, see Section B.3.3.5, “Where MySQL Stores Temporary Files”.
--user={
,
user_name
|user_id
}-u
{
user_name
|user_id
}
Command-Line Format | --user=name |
---|---|
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.
--validate-user-plugins[={OFF|ON}]
Command-Line Format | --validate-user-plugins[={OFF|ON}] |
---|---|
Introduced | 5.6.11 |
Type | Boolean |
Default Value | ON |
If this option is enabled (the default), the server checks each user account and produces a warning if conditions are found that would make the account unusable:
The account requires an authentication plugin that is not loaded.
The account requires the
sha256_password
authentication plugin
but the server was started with neither SSL nor RSA
enabled as required by this plugin.
Enabling
--validate-user-plugins
slows
down server initialization and FLUSH
PRIVILEGES
. If you do not require the additional
checking, you can disable this option at startup to avoid the
performance decrement.
Use this option with the --help
option for detailed help.
--version
, -V
Display version information and exit.