This statement installs a plugin.
plugin_name is the name of the plugin
as defined in the plugin declaration structure contained in the
library file. Plugin name case sensitivity is determined by the
host system filename semantics.
plugin_library is the name of the
shared library that contains the plugin code. The name includes
the filename extension (for example,
The shared library must be located in the plugin directory (that
is, the directory named by the
system variable). The library must be in the plugin directory
itself, not in a subdirectory. By default,
plugin_dir is the directory named by the
pkglibdir configuration variable, but it can
be changed by setting the value of
at server startup. For example, set its value in a
If the value of
plugin_dir is a relative
pathname, it is taken to be relative to the MySQL base directory
(the value of the
basedir system variable).
INSTALL PLUGIN adds a line to the
mysql.plugin table that describes the
plugin. This table contains the plugin name
and library filename.
INSTALL PLUGIN also loads and initializes the
plugin code to make the plugin available for use. A plugin is
initialized by executing its initialization function, which
handles any setup that the plugin must perform before it can be
INSTALL PLUGIN, you must have the
INSERT privilege for the
At server startup, the server loads and initializes any plugin
that is listed in the
This means that a plugin is installed with
PLUGIN only once, not every time the server starts.
Plugin loading at startup does not occur if the server is
started with the
When the server shuts down, it executes the deinitialization function for each plugin that is loaded so that the plugin has a change to perform any final cleanup.
To remove a plugin entirely, use the
To see what plugins are installed, use the
If you recompile a plugin library and need to reinstall it, you can use either of the following procedures:
UNINSTALL PLUGIN to uninstall all
plugins in the library, install the new plugin library file
in the plugin directory, and then use
PLUGIN to install all plugins in the library. This
procedure has the advantage that it can be used without
stopping the server. However, if the plugin library contains
many plugins, you must issue many
Alternatively, stop the server, install the new plugin library file in the plugin directory, and then restart the server.