Keyring service consumers require a keyring plugin to be installed. MySQL provides these plugin choices:
keyring_file: Stores keyring data in a file local to the server host. Available in all MySQL distributions.
keyring_encrypted_file: Stores keyring data in an encrypted file local to the server host. Available in MySQL Enterprise Edition distributions.
keyring_okv: Uses KMIP-compatible back end keyring storage products such as Oracle Key Vault and Gemalto SafeNet KeySecure Appliance. Available in MySQL Enterprise Edition distributions.
keyring_aws: Communicates with the Amazon Web Services Key Management Service as a back end for key generation and uses a local file for key storage. Available in MySQL Enterprise Edition distributions.
keyring_hashicorp: Communicates with HashiCorp Vault for back end storage. Available in MySQL Enterprise Edition distributions.
This section describes how to install the keyring plugin of your choosing. For general information about installing plugins, see Section 5.6.1, “Installing and Uninstalling Plugins”.
If you intend to use keyring user-defined functions (UDFs) in conjunction with the keyring plugin, install the UDFs after installing the plugin, using the instructions in Section 220.127.116.11, “General-Purpose Keyring Key-Management Functions”.
To be usable by the server, the plugin library file must be
located in the MySQL plugin directory (the directory named by
variable). If necessary, configure the plugin directory location
by setting the value of
plugin_dir at server startup.
Installation for each keyring plugin is similar. The following
keyring_file. Users of a
different keyring plugin can substitute its name for
keyring_file plugin library file base
keyring_file. The file name suffix
differs per platform (for example,
Unix and Unix-like systems,
Only one keyring plugin should be enabled at a time. Enabling multiple keyring plugins is unsupported and results may not be as anticipated.
The keyring plugin must be loaded early during the server
startup sequence so that components can access it as necessary
during their own initialization. For example, the
InnoDB storage engine uses the keyring for
tablespace encryption, so the keyring plugin must be loaded and
available prior to
To load the plugin, use the
--early-plugin-load option to
name the plugin library file that contains it. For example, on
platforms where the plugin library file suffix is
.so, use these lines in the server
my.cnf file, adjusting the
.so suffix for your platform as necessary:
Before starting the server, check the notes for your chosen keyring plugin to see whether it permits or requires additional configuration:
keyring_file: Section 18.104.22.168, “Using the keyring_file File-Based Plugin”.
keyring_encrypted_file: Section 22.214.171.124, “Using the keyring_encrypted_file Keyring Plugin”.
keyring_okv: Section 126.96.36.199, “Using the keyring_okv KMIP Plugin”.
keyring_hashicorp: Section 188.8.131.52, “Using the HashiCorp Vault Keyring Plugin”
After performing any plugin-specific configuration, verify
plugin installation. With the MySQL server running, examine the
INFORMATION_SCHEMA.PLUGINS table or
SHOW PLUGINS statement
(see Section 5.6.2, “Obtaining Server Plugin Information”). For
mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'keyring%'; +--------------+---------------+ | PLUGIN_NAME | PLUGIN_STATUS | +--------------+---------------+ | keyring_file | ACTIVE | +--------------+---------------+
If the plugin fails to initialize, check the server error log for diagnostic messages.
Plugins can be loaded by methods other than
--early-plugin-load, such as the
--plugin-load-add option or the
INSTALL PLUGIN statement.
However, keyring plugins loaded using those methods may be
available too late in the server startup sequence for certain
components, such as
Plugins installed using
INSTALL PLUGINare registered in the
mysql.pluginsystem table and loaded automatically for subsequent server restarts. However, because
InnoDBtable, any plugins named in it can be loaded during startup only after
If no keyring plugin is available when a component tries to
access the keyring service, the service cannot be used by that
component. As a result, the component may fail to initialize or
may initialize with limited functionality. For example, if
InnoDB finds that there are encrypted
tablespaces when it initializes, it attempts to access the
keyring. If the keyring is unavailable,
InnoDB can access only unencrypted
tablespaces. To ensure that
InnoDB can access
encrypted tablespaces as well, use
--early-plugin-load to load the