after reading the relevant information, I installed the key vault plugin and easily made it work over SSL with Hashicorp Vault. I am running with innodb_file_per_table=ON.
Then I proceeded to encrypt one table to see what happened:
ALTER TABLE `clients` ENCRYPTION='Y'
To my big surprise, this encrypted all tables on almost all databases! Only the MySQL databases were left “untouched”.
The MySQL database has been created during installation and then I edited the configuration file and added the various encryption settings. Your hypothesis seems sound.
What’s not clear is the documentation.
It says:
General tablespace encryption is enabled by the following syntax extension:
mysql> CREATE TABLESPACE tablespace_name ... ENCRYPTION='Y'
By reading the above I’d have expected to have to create such a tablespace and then move into it the tables I wanted to encrypt.
Furthermore, as shown in the example below those instructions, I understood the
innodb_encrypt_tables=ON
setting would just avoid me the hassle of modifying all my gzipped exported backups to add a
ENCRYPTION="Y";
at the end of the CREATE TABLE statements.
The example gave me the impression that table encryption would be a “voluntary” decision and that - in any case - would only encrypt newly created (or manually ALTERed) tables, not every pre-existing InnoDB table in every database.
Please excuse me, but I would understand this as: “makes InnoDB tables encrypted by default… from now on”. Not everything and in a retroactive way.
It’s all ok and nice with me, because I am experimenting on research & development servers.
Lesson learned.
However, you might want to adjust the instructions so that they are more explicit about what is going to happen.
Why? Because with the advent of European GDPR privacy law, you’ll soon get a lot of people (starting from us) installing Percona’s file or key vault encryption plugins and I am sure that some of them will do that on live servers and will get both this “unexpected” automatic encryption behavior on their legacy databases and the issue I filed on the other thread Lorraine linked above.
I’ll take an action to ask the team to review the documentation taking your comments into account to see if we can make the instructions more explicit.
“Please excuse me, but I would understand this as: “makes InnoDB tables encrypted by default… from now on”. Not everything and in a retroactive way.”
But this is exactly how it works - encrypted by default from now on. This is why all tables in your mysql database remained un-encrypted as I explained before.