The server can load plugins under the control of startup options.
For example, many storage engines can be built in pluggable form
and loaded when the server starts. In the following descriptions,
plugin_name
stands for a plugin name
such as innodb
.
As of MySQL 5.4.2, options used to control plugin loading have a tristate format:
--
plugin_name
=OFF
Do not enable the plugin.
--
plugin_name
[=ON]
Enable the plugin. If plugin initialization fails, start the
server anyway, but with the plugin disabled. Specifying the
option as
--
without a value also enables the plugin.
plugin_name
--
plugin_name
=FORCE
Enable the plugin. If plugin initialization fails, do not start the server. In other words, force the server to run with the plugin or not at all.
The values OFF
, ON
, and
FORCE
are not case sensitive.
If a plugin is disabled, either explicitly with
OFF
or implicitly because it was enabled with
ON
but failed to initialize, aspects of server
operation that require the plugin will change. For example, if the
plugin implements a storage engine, existing tables for the
storage engine become inaccessible, and attempts to create new
tables for the storage engine result in tables that use the
default storage engine unless the
NO_ENGINE_SUBSTITUTION
SQL mode
has been enabled to cause an error to occur instead.
Suppose that CSV
, InnoDB
,
and ARCHIVE
are built as pluggable storage
engines and that you want the server to load them at startup,
subject to these conditions: The server is allowed to run if
CSV
initialization fails, but must require that
InnoDB
initialization succeed.
ARCHIVE
should be disabled. To accomplish that,
use these lines in an option file:
[mysqld] csv=ON innodb=FORCE archive=OFF
--enable-
is also supported and is the same as
plugin_name
--
.
plugin_name
=ON--disable-
and plugin_name
--skip-
are also supported and are the same as
plugin_name
--
.
plugin_name
=OFF
Before MySQL 5.4.2, plugin options are boolean options (see Section 4.2.3.2, “Program Option Modifiers”). That is, any of these options enable the plugin:
--plugin_name
--plugin_name
=1 --enable-plugin_name
And these options disable the plugin:
--plugin_name
=0 --disable-plugin_name
--skip-plugin_name
If the plugin fails to initialize, the server runs with the plugin disabled.
If you upgrade to MySQL 5.4.2 or later from an older version and
previously used options of the form
--
or
plugin_name
=0--
, the
equivalent options are now
plugin_name
=1--
and
plugin_name
=OFF--
,
respectively. You also have the choice of requiring plugins to
start successfully by using
plugin_name
=ON--
.
plugin_name
=FORCE
Plugins can also be loaded at runtime, via the
INSTALL PLUGIN
statement (see
Section 12.4.3.4, “INSTALL PLUGIN
Syntax”).
User Comments
Add your own comment.