10bet网址
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr)- 36.3Mb
PDF (A4)- 36.3Mb
Man Pages (TGZ)- 235.6Kb
Man Pages (Zip)- 347.2Kb
Info (Gzip)- 3.3Mb
Info (Zip)- 3.3Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual/.../ mysql_plugin — Configure MySQL Server Plugins

4.4.3 mysql_plugin — Configure MySQL Server Plugins

Note

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-loador--plugin-load-addoption, or at runtime using theINSTALL PLUGINstatement.

Themysql_pluginutility enables MySQL administrators to manage which plugins a MySQL server loads. It provides an alternative to manually specifying the--plugin-loadoption at server startup or using theINSTALL PLUGINandUNINSTALL PLUGINstatements at runtime.

Depending on whethermysql_pluginis invoked to enable or disable plugins, it inserts or deletes rows in themysql.plugintable 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.pluginautomatically. For additional control over plugin activation, use--plugin_nameoptions named for specific plugins, as described inSection 5.5.1, “Installing and Uninstalling Plugins”.

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}

pluginis the name of the plugin to configure.ENABLEorDISABLE(not case-sensitive) specify whether to enable or disable components of the plugin library named in the configuration file. The order of thepluginandENABLEorDISABLEarguments does not matter.

For example, to configure components of a plugin library file namedmyplugins.soon Linux ormyplugins.dllon Windows, specify apluginvalue 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.iniand 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.inifile is the name of the library file, without any extension such as.soor.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, useDISABLErather 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-diroptions 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