MySQL Plugin Services It is not an error for there to be no locks in the namespace. 5.6.9.2 The Keyring Service MySQL Server supports a keyring service that enables internal components and plugins to securely store sensitive information for later retrieval. MySQL distributions provide a keyring interface that is accessible at two levels: This section describes how to use the keyring service functions to store, retrieve, and remove keys in the MySQL keyring keystore. For information about the SQL interface that uses functions, Section 6.4.4.14, “General-Purpose Keyring Key-Management Functions” . For general keyring information, see Section 6.4.4, “The MySQL Keyring” . The keyring service uses whatever underlying keyring plugin is enabled, if any. If no keyring plugin is enabled, keyring service calls fail. A “record”  in the keystore consists of data (the key itself) and a unique identifier through which the key is accessed. The identifier has two parts: Functions that implement the keyring function interface pass the value of  CURRENT_USER()  as the user_id  value to keyring service functions. The keyring service functions have these characteristics in common: Deobfuscates and retrieves a key from the keyring, along with its type. The function allocates the memory for the buffers used to store the returned key and key type. The caller should zero or obfuscate the memory when it is no longer needed, then free it. Syntax: 1141 bool my_key_fetch(const char *key_id, const char **key_type, const char* user_id, void **key, size_t *key_len) • my_key_fetch() These keyring service functions are available: •Keyring service functions treat key IDs, user names, types, and values as binary strings, so comparisons are case-sensitive. For example, IDs of  MyKey  and  mykey  refer to different keys. •The  key_type  argument provides additional information about the key, such as its encryption method or intended use. •The  key_id  and  user_id  arguments form a unique combination indicating which key in the keyring to use. •Each function returns 0 for success, 1 for failure. • user_id : The session effective user ID. If there is no user context, this value can be  NULL . The value need not actually be a “user” ; the meaning depends on the application. • key_id : The key ID or name.  key_id  values that begin with  mysql_  are reserved by MySQL Server. •At the SQL level, as a set of loadable functions that each map onto calls to the service routines. •As a C language interface, callable as a plugin service from server plugins or loadable functions.