The MySQL Keyring The following sections provide installation instructions for the keyring functions and demonstrate how to use them. For information about the keyring service functions invoked by these functions, see Section 5.6.9.2, “The Keyring Service” . For general keyring information, see Section 6.4.4, “The MySQL Keyring” . •Installing or Uninstalling General-Purpose Keyring Functions •Using General-Purpose Keyring Functions •General-Purpose Keyring Function Reference Installing or Uninstalling General-Purpose Keyring Functions This section describes how to install or uninstall the keyring functions, which are implemented in a plugin library file that also contains a  keyring_udf  plugin. For general information about installing or uninstalling plugins and loadable functions, see Section 5.6.1, “Installing and Uninstalling Plugins” , and Section 5.7.1, “Installing and Uninstalling Loadable Functions” . The keyring functions enable keyring key management operations, but the  keyring_udf  plugin must also be installed because the functions do not work correctly without it. Attempts to use the functions without the keyring_udf  plugin result in an error. To be usable by the server, the plugin library file must be located in the MySQL plugin directory (the directory named by the  plugin_dir  system variable). If necessary, configure the plugin directory location by setting the value of  plugin_dir  at server startup. The plugin library file base name is  keyring_udf . The file name suffix differs per platform (for example, .so  for Unix and Unix-like systems,  .dll  for Windows). To install the  keyring_udf  plugin and the keyring functions, use the  INSTALL PLUGIN  and  CREATE FUNCTION  statements, adjusting the  .so  suffix for your platform as necessary: INSTALL PLUGIN keyring_udf SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_generate RETURNS INTEGER SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_fetch RETURNS STRING SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_length_fetch RETURNS INTEGER SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_type_fetch RETURNS STRING SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_store RETURNS INTEGER SONAME ’keyring_udf.so’; CREATE FUNCTION keyring_key_remove RETURNS INTEGER SONAME ’keyring_udf.so’; If the plugin and functions are used on a source replication server, install them on all replicas as well to avoid replication issues. Once installed as just described, the plugin and functions remain installed until uninstalled. To remove them, use the  UNINSTALL PLUGIN  and  DROP FUNCTION  statements: UNINSTALL PLUGIN keyring_udf; DROP FUNCTION keyring_key_generate; DROP FUNCTION keyring_key_fetch; DROP FUNCTION keyring_key_length_fetch; DROP FUNCTION keyring_key_type_fetch; DROP FUNCTION keyring_key_store; DROP FUNCTION keyring_key_remove; Using General-Purpose Keyring Functions 1438