| 1 |
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; |
| 2 |
show warnings; |
| 3 |
Level Code Message |
| 4 |
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; |
| 5 |
show warnings; |
| 6 |
Level Code Message |
| 7 |
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2; |
| 8 |
show warnings; |
| 9 |
Level Code Message |
| 10 |
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; |
| 11 |
show warnings; |
| 12 |
Level Code Message |
| 13 |
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; |
| 14 |
show warnings; |
| 15 |
Level Code Message |
| 16 |
show create table innodb_compact; |
| 17 |
Table Create Table |
| 18 |
innodb_compact CREATE TABLE `innodb_compact` ( |
| 19 |
`c1` bigint(20) NOT NULL, |
| 20 |
`b` char(200) DEFAULT NULL |
| 21 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1 |
| 22 |
show create table innodb_compressed; |
| 23 |
Table Create Table |
| 24 |
innodb_compressed CREATE TABLE `innodb_compressed` ( |
| 25 |
`c1` bigint(20) NOT NULL, |
| 26 |
`b` char(200) DEFAULT NULL |
| 27 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2 |
| 28 |
show create table innodb_dynamic; |
| 29 |
Table Create Table |
| 30 |
innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 31 |
`c1` bigint(20) NOT NULL, |
| 32 |
`b` char(200) DEFAULT NULL |
| 33 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33 |
| 34 |
show create table innodb_redundant; |
| 35 |
Table Create Table |
| 36 |
innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 37 |
`c1` bigint(20) NOT NULL, |
| 38 |
`b` char(200) DEFAULT NULL |
| 39 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4 |
| 40 |
FLUSH TABLES innodb_normal FOR EXPORT; |
| 41 |
UNLOCK TABLES; |
| 42 |
FLUSH TABLES innodb_compact FOR EXPORT; |
| 43 |
UNLOCK TABLES; |
| 44 |
FLUSH TABLES innodb_compressed FOR EXPORT; |
| 45 |
UNLOCK TABLES; |
| 46 |
FLUSH TABLES innodb_dynamic FOR EXPORT; |
| 47 |
UNLOCK TABLES; |
| 48 |
FLUSH TABLES innodb_redundant FOR EXPORT; |
| 49 |
UNLOCK TABLES; |
| 50 |
select variable_value > 0 from information_schema.global_status |
| 51 |
where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED'; |
| 52 |
variable_value > 0 |
| 53 |
1 |
| 54 |
# restart |
| 55 |
BEGIN; |
| 56 |
INSERT INTO innodb_normal SET c1 = 1; |
| 57 |
INSERT INTO innodb_compact SET c1 = 1; |
| 58 |
INSERT INTO innodb_compressed SET c1 = 1; |
| 59 |
INSERT INTO innodb_dynamic SET c1 = 1; |
| 60 |
INSERT INTO innodb_redundant SET c1 = 1; |
| 61 |
COMMIT; |
| 62 |
FLUSH TABLES innodb_normal FOR EXPORT; |
| 63 |
UNLOCK TABLES; |
| 64 |
FLUSH TABLES innodb_compact FOR EXPORT; |
| 65 |
UNLOCK TABLES; |
| 66 |
FLUSH TABLES innodb_compressed FOR EXPORT; |
| 67 |
UNLOCK TABLES; |
| 68 |
FLUSH TABLES innodb_dynamic FOR EXPORT; |
| 69 |
UNLOCK TABLES; |
| 70 |
FLUSH TABLES innodb_redundant FOR EXPORT; |
| 71 |
UNLOCK TABLES; |
| 72 |
select variable_name from information_schema.global_status |
| 73 |
where variable_value > 0 and variable_name |
| 74 |
IN ('INNODB_NUM_PAGES_ENCRYPTED','INNODB_NUM_PAGES_DECRYPTED'); |
| 75 |
variable_name |
| 76 |
INNODB_NUM_PAGES_ENCRYPTED |
| 77 |
INNODB_NUM_PAGES_DECRYPTED |
| 78 |
SET GLOBAL innodb_encrypt_tables=OFF; |
| 79 |
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 80 |
show create table innodb_compact; |
| 81 |
Table Create Table |
| 82 |
innodb_compact CREATE TABLE `innodb_compact` ( |
| 83 |
`c1` bigint(20) NOT NULL, |
| 84 |
`b` char(200) DEFAULT NULL |
| 85 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPACT |
| 86 |
alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 87 |
show create table innodb_compressed; |
| 88 |
Table Create Table |
| 89 |
innodb_compressed CREATE TABLE `innodb_compressed` ( |
| 90 |
`c1` bigint(20) NOT NULL, |
| 91 |
`b` char(200) DEFAULT NULL |
| 92 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPRESSED |
| 93 |
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 94 |
show create table innodb_dynamic; |
| 95 |
Table Create Table |
| 96 |
innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 97 |
`c1` bigint(20) NOT NULL, |
| 98 |
`b` char(200) DEFAULT NULL |
| 99 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC |
| 100 |
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 101 |
show create table innodb_redundant; |
| 102 |
Table Create Table |
| 103 |
innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 104 |
`c1` bigint(20) NOT NULL, |
| 105 |
`b` char(200) DEFAULT NULL |
| 106 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=REDUNDANT |
| 107 |
FLUSH TABLES innodb_normal FOR EXPORT; |
| 108 |
UNLOCK TABLES; |
| 109 |
FLUSH TABLES innodb_compact FOR EXPORT; |
| 110 |
UNLOCK TABLES; |
| 111 |
FLUSH TABLES innodb_compressed FOR EXPORT; |
| 112 |
UNLOCK TABLES; |
| 113 |
FLUSH TABLES innodb_dynamic FOR EXPORT; |
| 114 |
UNLOCK TABLES; |
| 115 |
FLUSH TABLES innodb_redundant FOR EXPORT; |
| 116 |
UNLOCK TABLES; |
| 117 |
drop table innodb_normal; |
| 118 |
drop table innodb_compact; |
| 119 |
drop table innodb_compressed; |
| 120 |
drop table innodb_dynamic; |
| 121 |
drop table innodb_redundant; |
| 122 |
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES; |
| 123 |
INSERT INTO t1 VALUES (1),(2); |
| 124 |
# Restarting server... |
| 125 |
# restart |
| 126 |
SELECT * FROM t1; |
| 127 |
pk |
| 128 |
1 |
| 129 |
2 |
| 130 |
DROP TABLE t1; |