The MySQL Keyring From the administrative account, create an ordinary user account to which key access is to be granted: From the  key_user  account, verify that, without the proper  EXECUTE  privilege, the new account cannot access the shared key: From the administrative account, grant  EXECUTE  to  key_user  for the stored function: From the  key_user  account, verify that the key is now accessible: For each general-purpose keyring function, this section describes its purpose, calling sequence, and return value. For information about the conditions under which these functions can be invoked, see Using General-Purpose Keyring Functions. Given a key ID, deobfuscates and returns the key value. Arguments: Return value: Key values retrieved using  keyring_key_fetch()  are subject to the general keyring function limits described in Section 6.4.4.12, “Supported Keyring Key Types and Lengths” . A key value longer than that length can be stored using a keyring service function (see Section 5.6.9.2, “The Keyring Service” ), but if retrieved using  keyring_key_fetch()  is truncated to the general keyring function limit. Returns the key value as a string for success,  NULL  if the key does not exist, or  NULL  and an error for failure. Note General-Purpose Keyring Function Reference Example: • key_id : A string that specifies the key ID. • keyring_key_fetch( key_id ) 1442 | keyring_key_generate(’SharedKey’, ’DSA’, 8) | +---------------------------------------------+ | 1 | +---------------------------------------------+ mysql>  CREATE USER ’key_user’@’localhost’ IDENTIFIED BY ’key_user_pwd’; mysql>  SELECT HEX(key_schema.get_shared_key()); ERROR 1370 (42000): execute command denied to user ’key_user’@’localhost’ for routine ’key_schema.get_shared_key’ mysql>  GRANT EXECUTE ON FUNCTION key_schema.get_shared_key TO ’key_user’@’localhost’; mysql>  SELECT HEX(key_schema.get_shared_key()); +----------------------------------+ | HEX(key_schema.get_shared_key()) | +----------------------------------+ | 9BAFB9E75CEEB013 | +----------------------------------+