Windows 安装 MySQL 8.0 -- 输入3次 密码错误锁定账户

安装

下载地址:https://downloads.mysql.com/archives/installer/
需要有 .net framework 4.5.2 及以上版本才能安装 MySQL 5.8
image

image
选择自定义安装
image
选择要安装的服务
image
修改安装路径
image
image
image
image
image
image
设置ROOT 密码,认证方式,选下面一个,否则可能会出现,Authentication plugin ‘caching_sha2_password‘ cannot be loaded 原因及解决办法 https://www.cnblogs.com/vipsoft/p/17994296
image
image
image
image
image
image
image
测试
image

错误锁定帐号

MySQL 8.0.19版本之后,新增了一个功能,支持了输入3次错误密码锁定账户,这个功能可以有效防止恶意攻击者通过暴力破解密码获取非授权的数据库访问权限。一旦锁定账户,需要等待一定时间才能重新尝试登录。MySQL默认设置锁定时间为1小时。

安装插件

windows

mysql> install plugin CONNECTION_CONTROL soname 'connection_control.dll';
mysql> install plugin CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS soname 'connection_control.dll';

linux

mysql> install plugin CONNECTION_CONTROL soname 'connection_control.so';
mysql> install plugin CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS soname 'connection_control.so';

show variables like 'connection_%';
image

配置

MySQL Server8.0\my.ini

connection-control-failed-connections-threshold=3   #登陆失败次数限制
connection-control-min-connection-delay=6000000    #限制重试时间,此处为毫秒,注意按需求换算,此处为1小时

重启MySQL 服务
show variables like 'connection_%';
image

测试锁定帐号

image

posted @ 2024-01-29 10:59  VipSoft  阅读(24)  评论(0编辑  收藏  举报