【MySQL】常见问题处理记录

一、重置root密码
1.关闭mysql服务
2.在mysql安装目录的bin文件夹下,打开命令行界面,执行语句:
mysqld --console --skip-grant-tables --shared-memory
3.重新打开命令行窗口,进入mysql,切换到mysql数据库,执行更新密码语句
mysql -u root -p
user mysql;
update user set authentication_string=password(“qwpoeriu20”) where user=“root”;
flush privileges;

update user set authentication_string = password(‘Ha153624…’) where User = ‘root’
二、限制指定账户的访问ip
修改user表中的host字段

三、限制登录次数
安装插件
install plugin CONNECTION_CONTROL soname ‘connection_control.dll’;
卸载插件
UNINSTALL PLUGIN CONNECTION_CONTROL;
#查看是否安装成功
show variables like ‘connection_control%’;

#各参数解释
参数含义:
connection_control_failed_connections_threshold #单个用户登录失败(由于密码错误引起)次数上限,默认3次
connection_control_max_connection_delay #失败上限之后再次尝试登录前最大等待时间,单位ms
connection_control_min_connection_delay #失败上限之后再次尝试登录前最小等待时间,默认1秒(1000ms)

修改参数
//单个用户密码登录失败的上限次数
set global connection_control_failed_connections_threshold=5;
//达到失败上限后等待30秒再次尝试登录
set global connection_control_min_connection_delay=30000;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值