mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME LIKE 'keyring%';
+--------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+--------------+---------------+
| keyring_file | ACTIVE |
+--------------+---------------+
1 row in set (0.00 sec)
mysql> show variables like '%keyring%';
+-------------------+--------------------------------+
| Variable_name | Value |
+-------------------+--------------------------------+
| keyring_file_data | /var/lib/mysql-keyring/keyring |
+-------------------+--------------------------------+
1 row in set (0.00 sec)
mysql> CREATE TABLE InnoDB_tde (id int(11), c_desc varchar(100), c_comments text ) ENCRYPTION='Y';
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_OPTIONS FROM
INFORMATION_SCHEMA.TABLES WHERE CREATE_OPTIONS LIKE '%ENCRYPTION="Y"%';
+--------------+------------+----------------+
| TABLE_SCHEMA | TABLE_NAME | CREATE_OPTIONS |
+--------------+------------+----------------+
| test | InnoDB_tde | ENCRYPTION="Y" |
+--------------+------------+----------------+
1 row in set (0.01 sec)
mysql> INSERT INTO InnoDB_tde values (1, 'test tde' , 'InnoDB tde testing');
Query OK, 1 row affected (0.00 sec)
mysql> select * from InnoDB_tde;
+------+----------+--------------------+
| id | c_desc | c_comments |
+------+----------+--------------------+
| 1 | test tde | InnoDB tde testing |
+------+----------+--------------------+
1 row in set (0.01 sec)
# Disable - Enable ENCRYPTION from table
mysql> ALTER TABLE InnoDB_tde ENCRYPTION='N';
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE InnoDB_tde ENCRYPTION='Y';
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from InnoDB_tde;
+------+----------+--------------------+
| id | c_desc | c_comments |
+------+----------+--------------------+
| 1 | test tde | InnoDB tde testing |
+------+----------+--------------------+
1 row in set (0.00 sec)
#ENCRYPTION MASTER KEY Rotation
mysql> ALTER INSTANCE ROTATE INNODB MASTER KEY;
Query OK, 0 rows affected (0.01 sec)
mysql> select * from InnoDB_tde;
+------+----------+--------------------+
| id | c_desc | c_comments |
+------+----------+--------------------+
| 1 | test tde | InnoDB tde testing |
+------+----------+--------------------+
1 row in set (0.00 sec)