Plugins

MySQL Server is extensible through a plugin architecture covering authentication, replication, enterprise features, query rewriting, and more. To list the plugins currently installed:

SHOW PLUGINS;

Displays information about server plugins, including their status and type. See also Information Commands.

Security

Plugins are available for authenticating client connection attempts, covering several authentication protocols. A password-validation plugin implements password strength policies and assesses the strength of potential passwords. Keyring plugins provide secure storage for sensitive information. A connection-control plugin lets administrators introduce an increasing delay after a number of consecutive failed connection attempts.


Replication

Semisynchronous replication plugins implement an interface that permits the source to proceed as long as at least one replica has responded to each transaction. Group Replication lets a highly available, distributed MySQL service be built across a group of instances, with built-in data consistency, conflict detection/resolution, and group membership services.


Enterprise

MySQL Enterprise Edition includes several plugin-based features:


Rewriter (Query Rewrite)

Query rewrite plugins examine statements received by the server and can rewrite them before execution.


Version Tokens

Version Tokens creates and synchronizes server tokens that applications can use to prevent accessing incorrect or out-of-date data. It is based on a plugin library implementing a version_tokens plugin and a set of loadable functions.


Clone Plugin

The clone plugin permits cloning data locally or from a remote MySQL server instance – see the CLONE statement under Server Commands. Cloned data is a physical snapshot of InnoDB data, including schemas, tables, tablespaces, and data dictionary metadata, comprising a fully functional data directory usable for server provisioning.


X

The X Plugin extends MySQL Server to function as a document store. Running it enables the server to communicate with clients using the X Protocol, designed to expose the ACID-compliant storage abilities of MySQL as a document store.


Test Framework

MySQL distributions include plugins demonstrating how to test plugin service APIs:


-- List installed plugins and their status
SHOW PLUGINS;

-- Install the audit log plugin (MySQL Enterprise Audit)
INSTALL PLUGIN audit_log SONAME 'audit_log.so';

-- Install the clone plugin, then clone a remote instance
INSTALL PLUGIN clone SONAME 'mysql_clone.so';
CLONE INSTANCE FROM 'clone_user'@'donor.example.com':3306
    IDENTIFIED BY 'password';

-- Install Group Replication
INSTALL PLUGIN group_replication SONAME 'group_replication.so';

-- Confirm a plugin's active status
SELECT PLUGIN_NAME, PLUGIN_STATUS
FROM information_schema.PLUGINS
WHERE PLUGIN_NAME IN ('audit_log', 'clone', 'group_replication');

-- Remove a plugin no longer needed
UNINSTALL PLUGIN audit_log;