MENU
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:- MySQL Enterprise Thread Pool – the default thread-handling model executes each client connection's statements on one thread, which degrades performance as more clients connect. The thread pool plugin provides an alternative model that reduces overhead and improves performance by efficiently managing statement-execution threads for large numbers of connections.
- MySQL Enterprise Audit – implemented via the audit_log plugin, using the MySQL Audit API for standard, policy-based monitoring, logging, and blocking of connection and query activity, meeting the Oracle audit specification for compliance with internal and external regulatory guidelines. See also Logging.
- MySQL Enterprise Firewall – an application-level firewall letting administrators permit or deny SQL statement execution by matching against lists of accepted statement patterns, hardening the server against SQL injection and out-of-workload query attempts.
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:- test_framework – a bare-bones plugin showing the minimum required framework for service testing.
- test_services – demonstrates testing the my_plugin_log_service service in an unthreaded context.
- test_services_threaded – like test_services, but for a threaded context.
-- 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;