14.15 InnoDB Startup Options and System Variables
System variables that are true or false can be enabled at server startup by naming them, or disabled by using a
--skip-
prefix. For example, to enable or disable theInnoDB
adaptive hash index, you can use--innodb-adaptive-hash-index
or--skip-innodb-adaptive-hash-index
on the command line, orinnodb_adaptive_hash_index
orskip_innodb_adaptive_hash_index
in an option file.System variables that take a numeric value can be specified as
--
on the command line or asvar_name
=value
in option files.var_name
=value
Many system variables can be changed at runtime (see Section 5.1.8.2, “Dynamic System Variables”).
For information about
GLOBAL
andSESSION
variable scope modifiers, refer to theSET
statement documentation.Certain options control the locations and layout of the
InnoDB
data files. Section 14.8.1, “InnoDB Startup Configuration” explains how to use these options.Some options, which you might not use initially, help tune
InnoDB
performance characteristics based on machine capacity and your database workload.For more information on specifying options and system variables, see Section 4.2.2, “Specifying Program Options”.
Table 14.18 InnoDB Option and Variable Reference
InnoDB Command Options
-
Property Value Command-Line Format --innodb[=value]
Deprecated Yes Type Enumeration Default Value ON
Valid Values OFF
ON
FORCE
Controls loading of the
InnoDB
storage engine, if the server was compiled withInnoDB
support. This option has a tristate format, with possible values ofOFF
,ON
, orFORCE
. See Section 5.5.1, “Installing and Uninstalling Plugins”.To disable
InnoDB
, use--innodb=OFF
or--skip-innodb
. In this case, because the default storage engine isInnoDB
, the server does 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 andTEMPORARY
tables.The
InnoDB
storage engine can no longer be disabled, and the--innodb=OFF
and--skip-innodb
options are deprecated and have no effect. Their use results in a warning. These options will be removed in a future MySQL release. -
Property Value Command-Line Format --innodb-status-file[={OFF|ON}]
Type Boolean Default Value OFF
The
--innodb-status-file
startup option controls whetherInnoDB
creates a file namedinnodb_status.
in the data directory and writespid
SHOW ENGINE INNODB STATUS
output to it every 15 seconds, approximately.The
innodb_status.
file is not created by default. To create it, start mysqld with thepid
--innodb-status-file
option.InnoDB
removes the file when the server is shut down normally. If an abnormal shutdown occurs, the status file may have to be removed manually.The
--innodb-status-file
option is intended for temporary use, asSHOW ENGINE INNODB STATUS
output generation can affect performance, and theinnodb_status.
file can become quite large over time.pid
For related information, see Section 14.18.2, “Enabling InnoDB Monitors”.
Disable the
InnoDB
storage engine. See the description of--innodb
.
InnoDB System Variables
daemon_memcached_enable_binlog
Property Value Command-Line Format --daemon-memcached-enable-binlog[={OFF|ON}]
System Variable daemon_memcached_enable_binlog
Scope Global Dynamic No Type Boolean Default Value OFF
Enable this option on the source server to use the
InnoDB
memcached plugin (daemon_memcached
) with the MySQL binary log. This option can only be set at server startup. You must also enable the MySQL binary log on the source server using the--log-bin
option.For more information, see Section 14.21.6, “The InnoDB memcached Plugin and Replication”.
daemon_memcached_engine_lib_name
Property Value Command-Line Format --daemon-memcached-engine-lib-name=file_name
System Variable daemon_memcached_engine_lib_name
Scope Global Dynamic No Type File name Default Value innodb_engine.so
Specifies the shared library that implements the
InnoDB
memcached plugin.For more information, see Section 14.21.3, “Setting Up the InnoDB memcached Plugin”.
daemon_memcached_engine_lib_path
Property Value Command-Line Format --daemon-memcached-engine-lib-path=dir_name
System Variable daemon_memcached_engine_lib_path
Scope Global Dynamic No Type Directory name Default Value NULL
The path of the directory containing the shared library that implements the
InnoDB
memcached plugin. The default value is NULL, representing the MySQL plugin directory. You should not need to modify this parameter unless specifying amemcached
plugin for a different storage engine that is located outside of the MySQL plugin directory.For more information, see Section 14.21.3, “Setting Up the InnoDB memcached Plugin”.
-
Property Value Command-Line Format --daemon-memcached-option=options
System Variable daemon_memcached_option
Scope Global Dynamic No Type String Default Value Used to pass space-separated memcached options to the underlying memcached memory object caching daemon on startup. For example, you might change the port that memcached listens on, reduce the maximum number of simultaneous connections, change the maximum memory size for a key-value pair, or enable debugging messages for the error log.
See Section 14.21.3, “Setting Up the InnoDB memcached Plugin” for usage details. For information about memcached options, refer to the memcached man page.
-
Property Value Command-Line Format --daemon-memcached-r-batch-size=#
System Variable daemon_memcached_r_batch_size
Scope Global Dynamic No Type Integer Default Value 1
Specifies how many memcached read operations (
get
operations) to perform before doing aCOMMIT
to start a new transaction. Counterpart ofdaemon_memcached_w_batch_size
.This value is set to 1 by default, so that any changes made to the table through SQL statements are immediately visible to memcached operations. You might increase it to reduce the overhead from frequent commits on a system where the underlying table is only being accessed through the memcached interface. If you set the value too large, the amount of undo or redo data could impose some storage overhead, as with any long-running transaction.
For more information, see Section 14.21.3, “Setting Up the InnoDB memcached Plugin”.
-
Property Value Command-Line Format --daemon-memcached-w-batch-size=#
System Variable daemon_memcached_w_batch_size
Scope Global Dynamic No Type Integer Default Value 1
Specifies how many memcached write operations, such as
add
,set
, andincr
, to perform before doing aCOMMIT
to start a new transaction. Counterpart ofdaemon_memcached_r_batch_size
.This value is set to 1 by default, on the assumption that data being stored is important to preserve in case of an outage and should immediately be committed. When storing non-critical data, you might increase this value to reduce the overhead from frequent commits; but then the last
N
-1 uncommitted write operations could be lost if a crash occurs.For more information, see Section 14.21.3, “Setting Up the InnoDB memcached Plugin”.
-
Property Value Command-Line Format --ignore-builtin-innodb[={OFF|ON}]
Deprecated Yes System Variable ignore_builtin_innodb
Scope Global Dynamic No Type Boolean In earlier versions of MySQL, enabling this variable caused the server to behave as if the built-in
InnoDB
were not present, which enabled theInnoDB Plugin
to be used instead. In MySQL 5.7,InnoDB
is the default storage engine andInnoDB Plugin
is not used, so this variable is ignored. -
Property Value Command-Line Format --innodb-adaptive-flushing[={OFF|ON}]
System Variable innodb_adaptive_flushing
Scope Global Dynamic Yes Type Boolean Default Value ON
Specifies whether to dynamically adjust the rate of flushing dirty pages in the
InnoDB
buffer pool based on the workload. Adjusting the flush rate dynamically is intended to avoid bursts of I/O activity. This setting is enabled by default. See Section 14.8.3.5, “Configuring Buffer Pool Flushing” for more information. For general I/O tuning advice, see Section 8.5.8, “Optimizing InnoDB Disk I/O”. -
Property Value Command-Line Format --innodb-adaptive-flushing-lwm=#
System Variable innodb_adaptive_flushing_lwm
Scope Global Dynamic Yes Type Integer Default Value 10
Minimum Value 0