MySQL8 的加密 Data-at-Rest Encryption ERROR 3185 (HY000):

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: MySQL 5.7.11引入了InnoDB表空间加密,该加密启用了对每表文件表空间的支持。

MySQL 5.7.11引入了InnoDB表空间加密,该加密启用了对每表文件表空间的支持。在MySQL 8.0.13中, 引入了通用表空间的加密。为了提高加密处理的可用性,MySQL 8.0.16添加了几个功能,这些功能允许数据库管理员进行更精细的控制。

加载加密插件:


mysql> install plugin keyring_file soname 'keyring_file.so';
Query OK, 0 rows affected (0.26 sec)
mysql>  CREATE TABLE t1 (c1 INT) ENCRYPTION = 'Y';
Query OK, 0 rows affected (1.02 sec)

加载加密插件,如果不加载加密插件,会提示出错:


mysql> CREATE TABLE t1 (c1 INT) ENCRYPTION = 'Y';
ERROR 3185 (HY000): Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.


如果启动的时候没有加载keyring_file.so,提示:


2020-06-17T03:51:31.246965Z 1 [ERROR] [MY-012657] [InnoDB] Encryption can't find master key, please check the keyring plugin is loaded.
2020-06-17T03:51:31.247237Z 1 [ERROR] [MY-012226] [InnoDB] Encryption information in datafile: ./b/t1.ibd can't be decrypted, please confirm the keyfile is match and keyring plugin is loaded.


加入[mysqld] early-plugin-load=keyring_file.so 可以在innodb启动前加载keyring。

注意:


对系统中的所有表进行加密。这可以通过系统范围的配置设置default_table_encryption实现

对模式中所有表进行加密,可以在创建模式时设置默认的加密属性。 表空间不能混合使用加密和未加密的块。因此,表空间是未加密的或已加密的。

有一些子句可以覆盖默认的加密设置。可以通过配置设置table_encryption_privilege_check = true 来要求服务器禁止覆盖加密设置。具有TABLE_ENCRYPTION_ADMIN权限的用户始终可以覆盖任何检查。


相关文章
|
4月前
|
关系型数据库 MySQL
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
329 0
|
3月前
|
关系型数据库 MySQL
ERROR 1449 (HY000): The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist
ERROR 1449 (HY000): The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist
21 0
|
6月前
|
关系型数据库 MySQL Devops
docker容器刚启动就停止 — 运行mysql 报错 mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
docker容器刚启动就停止 — 运行mysql 报错 mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
258 0
|
3月前
|
SQL 数据采集 关系型数据库
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
|
2天前
|
SQL 关系型数据库 MySQL
:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
10 0
|
24天前
|
关系型数据库 MySQL 数据安全/隐私保护
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
27 0
|
6月前
|
关系型数据库 MySQL
Mysql报错:InnoDB: Operating system error number 13 in a fil..的解决方法
Mysql报错:InnoDB: Operating system error number 13 in a fil..的解决方法
116 0
|
6月前
|
SQL 监控 关系型数据库
Mysql主从同步报错解决:Error executing row event: Table zabbix.history-..
Mysql主从同步报错解决:Error executing row event: Table zabbix.history-..
|
3月前
|
SQL 存储 关系型数据库
MySQL 时间日期函数,流程控制函数,加密解密函数以及聚合查询函数
MySQL 时间日期函数,流程控制函数,加密解密函数以及聚合查询函数
47 0
|
4月前
|
SQL 关系型数据库 MySQL
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
27 0
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version