I successfully encrypted my MariaDB database using file_key_management and following this guide. Now I'd like to change the encryption key and suppose I need to decrypt the database first, before I can apply a new one.
ALTER TABLE mytable ENCRYPTED=NO;
I was able to decrypt all tables using this command. I was also able to decrypt also the system tables using the SET GLOBAL command and the server now starts unencrypted without a key.
With a new key, however, I still get an error message saying wrong decryption key. Why does the database still remember the old key and how to set a new one?
SET GLOBAL innodb_encrypt_tables=OFF;
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION