我是靠谱客的博主 雪白悟空,这篇文章主要介绍【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;

最后

以上就是雪白悟空最近收集整理的关于【MySQL】常见问题处理记录的全部内容,更多相关【MySQL】常见问题处理记录内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(141)

评论列表共有 0 条评论

立即
投稿
返回
顶部