安装插件:
mysql> install plugin CONNECTION_CONTROL soname 'connection_control.so';
mysql>install plugin CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS soname 'connection_control.so';
修改/etc/my.cnf,增加以下配置,重启生效:
[mysqld]
plugin-load-add=validate_password.so
connection-control-failed-connections-threshold=5 #登陆失败次数限制
connection-control-min-connection-delay=300000 #限制重试时间,此处为毫秒,注意按需求换算,此处为5分钟