DROP ENCRYPTKEY
Descriptionβ
Delete a custom key. The name of the key is exactly the same to be deleted.
Syntaxβ
DROP ENCRYPTKEY [IF EXISTS] <key_name>
Required Parametersβ
1. <key_name>
Specifies the name of the key to be deleted, which may include a database identifier. Example:
db1.my_key
Optional Parametersβ
1. [IF EXISTS]
If specified, no error will be thrown when attempting to delete a non-existent key.
Access Control Requirementsβ
The user executing this SQL command must possess the following minimum privileges:
Privilege | Object | Notes |
---|---|---|
ADMIN_PRIV | User / Role | The user or role must hold theADMIN_PRIV privilege to perform key deletion operations |
Exampleβ
-
Delete a key
DROP ENCRYPTKEY my_key;
-
Drop a key without throwing errors if it doesn't exist
DROP ENCRYPTKEY IF EXISTS testdb.my_key;