mysql表空间加密

1)登陆mysql

mysql -u root -p

2)安装keyring插件

INSTALL PLUGIN keyring_file  soname 'keyring_file.so';

3)查看keyring插件

show global variables like '%keyring_file_data%';
show plugins;

4)创建加密表

create table  test1(
    -> id int  primary key auto_increment,
    -> name varchar(20),
    -> key name(name))
    ->  ENCRYPTION='Y';

5)插入加密表

insert into  test1(id,name) values(1,'anm'),(2,'keyring');

6)查看表创建方式

show  create table test1;

7)异常情况

keyring_file.so保存在 /usr/lib/mysql/plugin/,如果删除keyring_file.so,则加密表的数据不能打开。

mysql> select  * from test1;
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.

参考

https://blog.csdn.net/gjc592/article/details/108047390?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159858664819195162548193%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=159858664819195162548193&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-108047390.pc_ecpm_v3_pc_rank_v3&utm_term=mysql%E8%A1%A8%E7%A9%BA%E9%97%B4%E5%8A%A0%E5%AF%86&spm=1018.2118.3001.4187

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值