windows下的mysql安装connection_control

环境:
OS:Windows 2012
mysql:5.7.29

 

1.root账号登录mysql
mysql>mysql -h localhost -uroot -pmysql -P13306
mysql>install plugin connection_control soname 'connection_control.dll';
mysql>install plugin connection_control_failed_login_attempts soname 'connection_control.dll';

文件存储在D:\mysql57\lib\plugin目录下

 

2.查看
mysql> select plugin_name, plugin_status from information_schema.plugins where p
lugin_name like 'connection%';
+------------------------------------------+---------------+
| plugin_name | plugin_status |
+------------------------------------------+---------------+
| CONNECTION_CONTROL | ACTIVE |
| CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS | ACTIVE |
+------------------------------------------+---------------+
2 rows in set (0.00 sec)

 

3.查看各变量
show variables like '%connection_control_failed_connections_threshold%';
show variables like '%connection_control_min_connection_delay%';
show variables like '%connection_control_max_connection_delay%';

 

4.安装要求设置
mysql> SET GLOBAL connection_control_failed_connections_threshold = 3; ##s失败尝试的次数,默认为3,表示当连接失败3次后启用连接控制,0表示不开启
mysql> SET GLOBAL connection_control_min_connection_delay = 1000; ##响应延迟的最小时间,默认 1000 微秒,1秒 表示等待时间,单位是毫秒,这里是1秒,若锁15分钟,则设置为9000000
mysql> SET GLOBAL connection_control_max_connection_delay = 2147483647; ##响应延迟的最大时间,默认约25天

这样设置重启会失效,可以将这些配置写入到my.cnf文件
connection_control_failed_connections_threshold = 3
connection_control_min_connection_delay = 1000
connection_control_max_connection_delay = 2147483647

 

posted @   slnngk  阅读(424)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-10-26 pg_basebackup备份恢复(带自定义表空间)
2022-10-26 postgresql迁移表空间
2020-10-26 Error in invoking target 'agent nmhs' of makefile
2020-10-26 打补丁(18370031)
点击右上角即可分享
微信分享提示