MySQL Keyring plugins support the following system variables. Use them to configure keyring plugin operation. These variables are unavailable unless the appropriate keyring plugin is installed (see Section 6.4.1, “Keyring Plugin Installation”).
-
Command-Line Format --keyring-aws-cmk-id=valueIntroduced 5.7.19 System Variable keyring_aws_cmk_idScope Global Dynamic Yes Type String The customer master key (CMK) ID obtained from the AWS KMS server and used by the
keyring_awsplugin. This variable is unavailable unless that plugin is installed.This variable is mandatory. If not specified,
keyring_awsinitialization fails. -
Command-Line Format --keyring-aws-conf-file=file_nameIntroduced 5.7.19 System Variable keyring_aws_conf_fileScope Global Dynamic No Type File name Default Value platform specificThe location of the configuration file for the
keyring_awsplugin. This variable is unavailable unless that plugin is installed.At plugin startup,
keyring_awsreads the AWS secret access key ID and key from the configuration file. For thekeyring_awsplugin to start successfully, the configuration file must exist and contain valid secret access key information, initialized as described in Section 6.4.5, “Using the keyring_aws Amazon Web Services Keyring Plugin”.The default file name is
keyring_aws_conf, located in the default keyring file directory. The location of this default directory is the same as for thekeyring_file_datasystem variable. See the description of that variable for details, as well as for considerations to take into account if you create the directory manually. -
Command-Line Format --keyring-aws-data-fileIntroduced 5.7.19 System Variable keyring_aws_data_fileScope Global Dynamic No Type File name Default Value platform specificThe location of the storage file for the
keyring_awsplugin. This variable is unavailable unless that plugin is installed.At plugin startup, if the value assigned to
keyring_aws_data_filespecifies a file that does not exist, thekeyring_awsplugin attempts to create it (as well as its parent directory, if necessary). If the file does exist,keyring_awsreads any encrypted keys contained in the file into its in-memory cache.keyring_awsdoes not cache unencrypted keys in memory.The default file name is
keyring_aws_data, located in the default keyring file directory. The location of this default directory is the same as for thekeyring_file_datasystem variable. See the description of that variable for details, as well as for considerations to take into account if you create the directory manually. -
Command-Line Format --keyring-aws-region=valueIntroduced 5.7.19 System Variable keyring_aws_regionScope Global Dynamic Yes Type Enumeration Default Value us-east-1Valid Values (≥ 5.7.39) af-south-1ap-east-1ap-northeast-1ap-northeast-2ap-northeast-3ap-south-1ap-southeast-1ap-southeast-2ca-central-1cn-north-1cn-northwest-1eu-central-1eu-north-1eu-south-1eu-west-1eu-west-2eu-west-3me-south-1sa-east-1us-east-1us-east-2us-gov-east-1us-iso-east-1us-iso-west-1us-isob-east-1us-west-1us-west-2Valid Values (≥ 5.7.27, ≤ 5.7.38) ap-northeast-1ap-northeast-2ap-south-1ap-southeast-1ap-southeast-2ca-central-1cn-north-1cn-northwest-1eu-central-1eu-west-1eu-west-2eu-west-3sa-east-1us-east-1us-east-2us-west-1us-west-2Valid Values (≥ 5.7.19, ≤ 5.7.26) ap-northeast-1ap-northeast-2ap-south-1ap-southeast-1ap-southeast-2eu-central-1eu-west-1sa-east-1us-east-1us-west-1us-west-2The AWS region for the
keyring_awsplugin. This variable is unavailable unless that plugin is installed.If not set, the AWS region defaults to
us-east-1. Thus, for any other region, this variable must be set explicitly. -
Command-Line Format --keyring-encrypted-file-data=file_nameIntroduced 5.7.21 System Variable keyring_encrypted_file_dataScope Global Dynamic Yes Type File name Default Value platform specificThe path name of the data file used for secure data storage by the
keyring_encrypted_fileplugin. This variable is unavailable unless that plugin is installed. The file location should be in a directory considered for use only by keyring plugins. For example, do not locate the file under the data directory.Keyring operations are transactional: The
keyring_encrypted_fileplugin uses a backup file during write operations to ensure that it can roll back to the original file if an operation fails. The backup file has the same name as the value of thekeyring_encrypted_file_datasystem variable with a suffix of.backup.Do not use the same
keyring_encrypted_filedata file for multiple MySQL instances. Each instance should have its own unique data file.The default file name is
keyring_encrypted, located in a directory that is platform specific and depends on the value of theINSTALL_LAYOUTCMake option, as shown in the following table. To specify the default directory for the file explicitly if you are building from source, use theINSTALL_MYSQLKEYRINGDIRCMake option.INSTALL_LAYOUTValueDefault keyring_encrypted_file_dataValueDEB,RPM,SLES,SVR4/var/lib/mysql-keyring/keyring_encryptedOtherwise keyring/keyring_encryptedunder theCMAKE_INSTALL_PREFIXvalueAt plugin startup, if the value assigned to
keyring_encrypted_file_dataspecifies a file that does not exist, thekeyring_encrypted_fileplugin attempts to create it (as well as its parent directory, if necessary).If you create the directory manually, it should have a restrictive mode and be accessible only to the account used to run the MySQL server. For example, on Unix and Unix-like systems, to use the
/usr/local/mysql/mysql-keyringdirectory, the following commands (executed asroot) create the directory and set its mode and ownership:cd /usr/local/mysql mkdir mysql-keyring chmod 750 mysql-keyring chown mysql mysql-keyring chgrp mysql mysql-keyringIf the
keyring_encrypted_fileplugin cannot create or access its data file, it writes an error message to the error log. If an attempted runtime assignment tokeyring_encrypted_file_dataresults in an error, the variable value remains unchanged.ImportantOnce the
keyring_encrypted_fileplugin has created its data file and started to use it, it is important not to remove the file. Loss of the file causes data encrypted using its keys to become inaccessible. (It is permissible to rename or move the file, as long as you change the value ofkeyring_encrypted_file_datato match.) keyring_encrypted_file_passwordCommand-Line Format --keyring-encrypted-file-password=passwordIntroduced 5.7.21 System Variable keyring_encrypted_file_passwordScope Global Dynamic Yes Type String The password used by the
keyring_encrypted_fileplugin. This variable is unavailable unless that plugin is installed.This variable is mandatory. If not specified,
keyring_encrypted_fileinitialization fails.If this variable is specified in an option file, the file should have a restrictive mode and be accessible only to the account used to run the MySQL server.
ImportantOnce the
keyring_encrypted_file_passwordvalue has been set, changing it does not rotate the keyring password and could make the server inaccessible. If an incorrect password is provided, thekeyring_encrypted_fileplugin cannot load keys from the encrypted keyring file.The password value cannot be displayed at runtime with
SHOW VARIABLESor the Performance Schemaglobal_variablestable because the display value is obfuscated.-
Command-Line Format --keyring-file-data=file_nameIntroduced 5.7.11 System Variable keyring_file_dataScope Global Dynamic Yes Type File name Default Value platform specificThe path name of the data file used for secure data storage by the
keyring_fileplugin. This variable is unavailable unless that plugin is installed. The file location should be in a directory considered for use only by keyring plugins. For example, do not locate the file under the data directory.Keyring operations are transactional: The
keyring_fileplugin uses a backup file during write operations to ensure that it can roll back to the original file if an operation fails. The backup file has the same name as the value of thekeyring_file_datasystem variable with a suffix of.backup.Do not use the same
keyring_filedata file for multiple MySQL instances. Each instance should have its own unique data file.The default file name is
keyring, located in a directory that is platform specific and depends on the value of theINSTALL_LAYOUTCMake option, as shown in the following table. To specify the default directory for the file explicitly if you are building from source, use theINSTALL_MYSQLKEYRINGDIRCMake option.INSTALL_LAYOUTValueDefault keyring_file_dataValueDEB,RPM,SLES,SVR4/var/lib/mysql-keyring/keyringOtherwise keyring/keyringunder theCMAKE_INSTALL_PREFIXvalueAt plugin startup, if the value assigned to
keyring_file_dataspecifies a file that does not exist, thekeyring_fileplugin attempts to create it (as well as its parent directory, if necessary).If you create the directory manually, it should have a restrictive mode and be accessible only to the account used to run the MySQL server. For example, on Unix and Unix-like systems, to use the
/usr/local/mysql/mysql-keyringdirectory, the following commands (executed asroot) create the directory and set its mode and ownership:cd /usr/local/mysql mkdir mysql-keyring chmod 750 mysql-keyring chown mysql mysql-keyring chgrp mysql mysql-keyringIf the
keyring_fileplugin cannot create or access its data file, it writes an error message to the error log. If an attempted runtime assignment tokeyring_file_dataresults in an error, the variable value remains unchanged.ImportantOnce the
keyring_fileplugin has created its data file and started to use it, it is important not to remove the file. For example,InnoDBuses the file to store the master key used to decrypt the data in tables that useInnoDBtablespace encryption; see InnoDB Data-at-Rest Encryption. Loss of the file causes data in such tables to become inaccessible. (It is permissible to rename or move the file, as long as you change the value ofkeyring_file_datato match.) It is recommended that you create a separate backup of the keyring data file immediately after you create the first encrypted table and before and after master key rotation. -
Command-Line Format --keyring-okv-conf-dir=dir_nameIntroduced 5.7.12 System Variable keyring_okv_conf_dirScope Global Dynamic Yes Type Directory name Default Value empty stringThe path name of the directory that stores configuration information used by the
keyring_okvplugin. This variable is unavailable unless that plugin is installed. The location should be a directory considered for use only by thekeyring_okvplugin. For example, do not locate the directory under the data directory.The default
keyring_okv_conf_dirvalue is empty. For thekeyring_okvplugin to be able to access Oracle Key Vault, the value must be set to a directory that contains Oracle Key Vault configuration and SSL materials. For instructions on setting up this directory, see Section 6.4.4, “Using the keyring_okv KMIP Plugin”.The directory should have a restrictive mode and be accessible only to the account used to run the MySQL server. For example, on Unix and Unix-like systems, to use the
/usr/local/mysql/mysql-keyring-okvdirectory, the following commands (executed asroot) create the directory and set its mode and ownership:cd /usr/local/mysql mkdir mysql-keyring-okv chmod 750 mysql-keyring-okv chown mysql mysql-keyring-okv chgrp mysql mysql-keyring-okvIf the value assigned to
keyring_okv_conf_dirspecifies a directory that does not exist, or that does not contain configuration information that enables a connection to Oracle Key Vault to be established,keyring_okvwrites an error message to the error log. If an attempted runtime assignment tokeyring_okv_conf_dirresults in an error, the variable value and keyring operation remain unchanged. -
Introduced 5.7.21 System Variable keyring_operationsScope Global Dynamic Yes Type Boolean Default Value ONWhether keyring operations are enabled. This variable is used during key migration operations. See Section 6.4.7, “Migrating Keys Between Keyring Keystores”.