Plugins are server components that enhance MariaDB in some way. These can be
anything from new storage engines, plugins for enhancing full-text parsing, or
even small enhancements, such as a plugin to get a timestamp as an integer.

Querying Plugin Information
---------------------------

There are a number of ways to see which plugins are currently active.

A server almost always has a large number of active plugins, because the
server contains a large number of built-in plugins, which are active by
default and cannot be uninstalled.

Querying Plugin Information with SHOW PLUGINS
---------------------------------------------

The SHOW PLUGINS statement can be used to query information about all active
plugins.

For example:

SHOW PLUGINS\G;
********************** 1. row **********************
 Name: binlog
 Status: ACTIVE
 Type: STORAGE ENGINE
Library: NULL
License: GPL
********************** 2. row **********************
 Name: mysql_native_password
 Status: ACTIVE
 Type: AUTHENTICATION
Library: NULL
License: GPL
********************** 3. row **********************
 Name: mysql_old_password
 Status: ACTIVE
 Type: AUTHENTICATION
Library: NULL
License: GPL
...

If a plugin's Library column has a NULL value, then the plugin is built-in,
and it cannot be uninstalled.

Querying Plugin Information with information_schema.PLUGINS
-----------------------------------------------------------

The information_schema.PLUGINS table can be queried to get more detailed
information about plugins.

For example:

SELECT * FROM information_schema.PLUGINS\G
...
*************************** 6. row ***************************
     PLUGIN_NAME: CSV
    PLUGIN_VERSION: 1.0
    PLUGIN_STATUS: ACTIVE
     PLUGIN_TYPE: STORAGE ENGINE
 PLUGIN_TYPE_VERSION: 100003.0
    PLUGIN_LIBRARY: NULL
PLUGIN_LIBRARY_VERSION: NULL
    PLUGIN_AUTHOR: Brian Aker, MySQL AB
  PLUGIN_DESCRIPTION: CSV storage engine
    PLUGIN_LICENSE: GPL
     LOAD_OPTION: FORCE
   PLUGIN_MATURITY: Stable
 PLUGIN_AUTH_VERSION: 1.0
*************************** 7. row ***************************
     PLUGIN_NAME: MEMORY
    PLUGIN_VERSION: 1.0
    PLUGIN_STATUS: ACTIVE
     PLUGIN_TYPE: STORAGE ENGINE
 PLUGIN_TYPE_VERSION: 100003.0
    PLUGIN_LIBRARY: NULL
PLUGIN_LIBRARY_VERSION: NULL
    PLUGIN_AUTHOR: MySQL AB
  PLUGIN_DESCRIPTION: Hash based, stored in memory, useful for temporary
tables
    PLUGIN_LICENSE: GPL
     LOAD_OPTION: FORCE
   PLUGIN_MATURITY: Stable
 PLUGIN_AUTH_VERSION: 1.0
...

If a plugin's PLUGIN_LIBRARY column has the NULL value, then the plugin is
built-in, and it cannot be uninstalled.

Querying Plugin Information with mysql.plugin
---------------------------------------------

The mysql.plugin table can be queried to get information about installed
plugins.

This table only contains information about plugins that have been installed
via the following methods:

* The INSTALL SONAME statement.
* The INSTALL PLUGIN statement.
* The mysql_plugin utility.

This table does not contain information about:

* Built-in plugins.
* Plugins loaded with the --plugin-load-add option.
* Plugins loaded with the --plugin-load option.

This table only contains enough information to reload the plugin when the
server is restarted, which means it only contains the plugin name and the
plugin library.

For example:

SELECT * FROM mysql.plugin;

+------+------------+
| name | dl         |
+------+------------+
| PBXT | libpbxt.so |
+------+------------+

Installing a Plugin
-------------------

There are three primary ways to install a plugin:

* A plugin can be installed dynamically with an SQL statement.
* A plugin can be installed with a mysqld option, but it requires a server
restart.
* A plugin can be installed with the mysql_plugin utility, while the server is
completely offline.

When you are installing a plugin, you also have to ensure that:

* The server's plugin directory is properly configured, and the plugin's
library is in the plugin directory.
* The server's minimum plugin maturity is properly configured, and the plugin
is mature enough to be installed.

Installing a Plugin Dynamically
-------------------------------

A plugin can be installed dynamically by executing either the INSTALL SONAME
or the INSTALL PLUGIN statement.

If a plugin is installed with one of these statements, then a record will be
added to the mysql.plugins table for the plugin. This means that the plugin
will automatically be loaded every time the server restarts, unless
specifically uninstalled or deactivated.

Installing a Plugin with INSTALL SONAME
---------------------------------------

You can install a plugin dynamically by executing the INSTALL SONAME
statement. INSTALL SONAME installs all plugins from the given plugin library.
This could be required for some plugin libraries.

For example, to install all plugins in the server_audit plugin library (which
is currently only the server_audit audit plugin), you could execute the
following:

INSTALL SONAME 'server_audit';

Installing a Plugin with INSTALL PLUGIN
---------------------------------------

You can install a plugin dynamically by executing the INSTALL PLUGIN
statement. INSTALL PLUGIN installs a single plugin from the given plugin
library.

For example, to install the server_audit audit plugin from the server_audit
plugin library, you could execute the following:

INSTALL PLUGIN server_audit SONAME 'server_audit';
