The MySQL Keyring Before using the keyring general-purpose functions, install them according to the instructions provided in Installing or Uninstalling General-Purpose Keyring Functions. The keyring functions are subject to these constraints: •To use any keyring function, the  keyring_udf  plugin must be enabled. Otherwise, an error occurs: ERROR 1123 (HY000): Can’t initialize function ’keyring_key_generate’; This function requires keyring_udf plugin which is not installed. Please install To install the  keyring_udf  plugin, see Installing or Uninstalling General-Purpose Keyring Functions. •The keyring functions invoke keyring service functions (see Section 5.6.9.2, “The Keyring Service” ). The service functions in turn use whatever keyring plugin is installed (for example,  keyring_file or  keyring_okv ). Therefore, to use any keyring function, some underlying keyring plugin must be enabled. Otherwise, an error occurs: ERROR 3188 (HY000): Function ’keyring_key_generate’ failed because underlying keyring service returned an error. Please check if a keyring plugin is installed and that provided arguments are valid for the keyring you are using. To install a keyring plugin, see Section 6.4.4.3, “Keyring Plugin Installation” . Alternatively, should you prefer to avoid granting the global  EXECUTE  privilege while still permitting users to access specific key-management operations, “wrapper”  stored programs can be defined (a technique described later in this section). To grant the global  EXECUTE  privilege to a user, use this statement: ERROR 1123 (HY000): Can’t initialize function ’keyring_key_generate’; The user is not privileged to execute this function. User needs to have EXECUTE GRANT EXECUTE ON *.* TO  user ; •A user must possess the global  EXECUTE  privilege to use any keyring function. Otherwise, an error occurs: •A key stored in the keyring by a given user can be manipulated later only by the same user. That is, the value of the  CURRENT_USER()  function at the time of key manipulation must have the same value as when the key was stored in the keyring. (This constraint rules out the use of the keyring functions for manipulation of instance-wide keys, such as those created by  InnoDB  to support tablespace encryption.) •Keyring functions support the key types and lengths supported by the underlying keyring plugin. For information about keys specific to a particular keyring plugin, see Section 6.4.4.12, “Supported Keyring Key Types and Lengths” . To enable multiple users to perform operations on the same key, “wrapper”  stored programs can be defined (a technique described later in this section). To create a new random key and store it in the keyring, call  keyring_key_generate() , passing to it an ID for the key, along with the key type (encryption method) and its length in bytes. The following call creates a 2,048-bit DSA-encrypted key named  MyKey : mysql>  SELECT keyring_key_generate(’MyKey’, ’DSA’, 256); +-------------------------------------------+ | keyring_key_generate(’MyKey’, ’DSA’, 256) | +-------------------------------------------+ | 1 | 1439