等保审核 --- MySQL连接控制插件

环境介绍:

系统版本:Centos 7 

MySQL版本: 5.7.19(只有5.7.17版本后才有此插件)

架构: 主从架构

控制插件:

1). CONNECTION_CONTROL: 控制登录失败的次数及延迟响应时间
2). CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS: 记录登录失败的操作日志

 

操作过程:

1). 安装插件
2). 安装后配置
3). 增加至配置文件中

 

配置说明:

1). connection_control_min_connection_delay = 3000 : 当超过允许失败的次数时,将会延迟登录,此为最小延迟登录时间
2). connection_control_max_connection_delay = 86400 : 最大延迟登录时间
3). connection_control_failed_connections_threshold = 2 : 允许验证的次数

 

一、 安装插件

mysql> install plugin connection_control soname 'connection_control.so';
mysql> show plugins;
CONNECTION_CONTROL | ACTIVE | AUDIT | connection_control.so | GPL

mysql> show variables like '%connection_control%';
+-------------------------------------------------+-------+
| Variable_name | Value                      |
+-------------------------------------------------+-------+
| connection_control_failed_connections_threshold | 3    |
| connection_control_max_connection_delay         | 86400 |
| connection_control_min_connection_delay         | 6000  |
+-------------------------------------------------+-------+

 

二、 配置插件中参数

mysql> set global connection_control_failed_connections_threshold=2;
mysql> set global connection_control_min_connection_delay=3000;

 

三、 根据自己环境配置到配置文件中固定

~]# vim /etc/my.cnf
# 连接控制插件,重启后生效;
plugin-load-add = connection_control.so
connection_control_min_connection_delay = 3000
connection_control_max_connection_delay = 86400
connection_control_failed_connections_threshold = 2

 

posted @ 2020-09-02 13:49  k-free  阅读(305)  评论(0编辑  收藏  举报