| 1 |
SET GLOBAL innodb_encrypt_tables = ON; |
| 2 |
SET GLOBAL innodb_encryption_threads = 1; |
| 3 |
SET GLOBAL innodb_max_dirty_pages_pct = 99; |
| 4 |
SHOW VARIABLES LIKE 'innodb_encrypt%'; |
| 5 |
Variable_name Value |
| 6 |
innodb_encrypt_log OFF |
| 7 |
innodb_encrypt_tables ON |
| 8 |
innodb_encrypt_temporary_tables OFF |
| 9 |
innodb_encryption_rotate_key_age 1 |
| 10 |
innodb_encryption_rotation_iops 100 |
| 11 |
innodb_encryption_threads 1 |
| 12 |
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(255), f3 CHAR(255), |
| 13 |
f4 CHAR(255), f5 CHAR(255))ENGINE=INNODB; |
| 14 |
INSERT INTO t1 VALUES(1, "mysql", "mariadb", "batman", "superman"); |
| 15 |
INSERT INTO t1 SELECT * FROM t1; |
| 16 |
INSERT INTO t1 SELECT * FROM t1; |
| 17 |
INSERT INTO t1 SELECT * FROM t1; |
| 18 |
INSERT INTO t1 SELECT * FROM t1; |
| 19 |
# Wait max 10 min for key encryption threads to encrypt all spaces |
| 20 |
OPTIMIZE TABLE t1; |
| 21 |
Table Op Msg_type Msg_text |
| 22 |
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 23 |
test.t1 optimize status OK |
| 24 |
ALTER TABLE t1 FORCE; |
| 25 |
# Kill the server |
| 26 |
DROP TABLE t1; |