mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
58 lines
2.1 KiB
Text
58 lines
2.1 KiB
Text
SET @start_global_value = @@global.innodb_encryption_threads;
|
|
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
|
Variable_name Value
|
|
innodb_encrypt_log ON
|
|
innodb_encrypt_tables ON
|
|
innodb_encryption_rotate_key_age 15
|
|
innodb_encryption_rotation_iops 100
|
|
innodb_encryption_threads 4
|
|
DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
|
|
Field Type Null Key Default Extra
|
|
SPACE int(11) unsigned NO 0
|
|
NAME varchar(655) YES NULL
|
|
ENCRYPTION_SCHEME int(11) unsigned NO 0
|
|
KEYSERVER_REQUESTS int(11) unsigned NO 0
|
|
MIN_KEY_VERSION int(11) unsigned NO 0
|
|
CURRENT_KEY_VERSION int(11) unsigned NO 0
|
|
KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
|
|
KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
|
|
CURRENT_KEY_ID int(11) unsigned NO 0
|
|
# Wait max 5 min for key encryption threads to encrypt one space
|
|
# Success!
|
|
# Wait max 10 min for key encryption threads to encrypt all space
|
|
# Success!
|
|
# Now turn off encryption and wait for threads to decrypt everything
|
|
SET GLOBAL innodb_encrypt_tables = off;
|
|
# Wait max 10 min for key encryption threads to decrypt all space
|
|
# Success!
|
|
# Shutdown innodb_encryption_threads
|
|
SET GLOBAL innodb_encryption_threads=0;
|
|
# Turn on encryption
|
|
# since threads are off tables should remain unencrypted
|
|
SET GLOBAL innodb_encrypt_tables = on;
|
|
# Wait 15s to check that nothing gets encrypted
|
|
# Success!
|
|
# Startup innodb_encryption_threads
|
|
SET GLOBAL innodb_encryption_threads=@start_global_value;
|
|
# Wait 1 min to check that it start encrypting again
|
|
# Success!
|
|
#
|
|
# Check that restart with encryption turned off works
|
|
# even if spaces are encrypted
|
|
#
|
|
# First wait max 10 min for key encryption threads to encrypt all spaces
|
|
# Success!
|
|
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
|
|
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
|
Variable_name Value
|
|
innodb_encrypt_log ON
|
|
innodb_encrypt_tables OFF
|
|
innodb_encryption_rotate_key_age 15
|
|
innodb_encryption_rotation_iops 100
|
|
innodb_encryption_threads 0
|
|
SELECT COUNT(*) > 0 as should_be_1
|
|
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
|
|
WHERE MIN_KEY_VERSION <> 0;
|
|
should_be_1
|
|
1
|
|
# Restart mysqld again...with default options
|