mysql_pluginis deprecated as of MySQL 5.7.11 and removed in MySQL 8.0. Alternatives include loading plugins at server startup using the--plugin-load
or--plugin-load-add
option, or at runtime using theINSTALL PLUGIN
statement.
Themysql_pluginutility enables MySQL administrators to manage which plugins a MySQL server loads. It provides an alternative to manually specifying the--plugin-load
option at server startup or using theINSTALL PLUGIN
andUNINSTALL PLUGIN
statements at runtime.
Depending on whethermysql_pluginis invoked to enable or disable plugins, it inserts or deletes rows in themysql.plugin
table that serves as a plugin registry. (To perform this operation,mysql_plugininvokes the MySQL server in bootstrap mode. This means that the server must not already be running.) For normal server startups, the server loads and enables plugins listed inmysql.plugin
automatically. For additional control over plugin activation, use--
options named for specific plugins, as described inSection 5.5.1, “Installing and Uninstalling Plugins”.plugin_name
Each invocation ofmysql_pluginreads a configuration file to determine how to configure the plugins contained in a single plugin library file. To invokemysql_plugin, use this syntax:
mysql_plugin [options]plugin{ENABLE|DISABLE}
plugin
is the name of the plugin to configure.ENABLE
orDISABLE
(not case-sensitive) specify whether to enable or disable components of the plugin library named in the configuration file. The order of theplugin
andENABLE
orDISABLE
arguments does not matter.
For example, to configure components of a plugin library file namedmyplugins.so
on Linux ormyplugins.dll
on Windows, specify aplugin
value ofmyplugins
. Suppose that this plugin library contains three plugins,plugin1
,plugin2
, andplugin3
, all of which should be configured undermysql_plugincontrol. By convention, configuration files have a suffix of.ini
and the same base name as the plugin library, so the default configuration file name for this plugin library ismyplugins.ini
. The configuration file contents look like this:
myplugins plugin1 plugin2 plugin3
The first line in themyplugins.ini
file is the name of the library file, without any extension such as.so
or.dll
. The remaining lines are the names of the components to be enabled or disabled. Each value in the file should be on a separate line. Lines on which the first character is'#'
are taken as comments and ignored.
To enable the plugins listed in the configuration file, invokemysql_pluginthis way:
mysql_plugin myplugins ENABLE
To disable the plugins, useDISABLE
rather thanENABLE
.
An error occurs ifmysql_plugincannot find the configuration file or plugin library file, or ifmysql_plugincannot start the MySQL server.
mysql_pluginsupports the following options, which can be specified on the command line or in the[mysqld]
group of any option file. For options specified in a[mysqld]
group,mysql_pluginrecognizes the--basedir
,--datadir
, and--plugin-dir
options and ignores others. For information about option files used by MySQL programs, seeSection 4.2.2.2, “Using Option Files”.
Table 4.8 mysql_plugin Options
Option Name | Description |
---|---|
--basedir | The server base directory |
--datadir | The server data directory |
--help | Display help message and exit |
--my-print-defaults | Path to my_print_defaults |
--mysqld | Path to server |
--no-defaults | Do not read configuration file |
--plugin-dir | Directory where plugins are installed |
--plugin-ini | The plugin configuration file |
--print-defaults | Show configuration file defaults |
--verbose | Verbose mode |
--version | Display version information and exit |
--help
,-?
Display a help message and exit.
--basedir=
,dir_name
-b
dir_name
The server base directory.
——datadir =
,dir_name
-d
dir_name
The server data directory.
--my-print-defaults=
,file_name
-b
file_name
The path to themy_print_defaultsprogram.
--mysqld=
,file_name
-b
file_name
The path to themysqldserver.
Do not read values from the configuration file. This option enables an administrator to skip reading defaults from the configuration file.
Withmysql_plugin, this option need not be given first on the command line, unlike most other MySQL programs that support
--no-defaults
.--plugin-dir=
,dir_name
-p
dir_name
The server plugin directory.
--plugin-ini=
,file_name
-i
file_name
Themysql_pluginconfiguration file. Relative path names are interpreted relative to the current directory. If this option is not given, the default is
in the plugin directory, whereplugin
.iniplugin
is theplugin
argument on the command line.Display the default values from the configuration file. This option causesmysql_pluginto print the defaults for
--basedir
,--datadir
, and--plugin-dir
if they are found in the configuration file. If no value for a variable is found, nothing is shown.Withmysql_plugin, this option need not be given first on the command line, unlike most other MySQL programs that support
--print-defaults
.--verbose
,-v
Verbose mode. Print more information about what the program does. This option can be used multiple times to increase the amount of information.
--version
,-V
Display version information and exit.