Linux-012-Centos mysql 5.6.50 忘记密码,重置密码
# 停止 mysql 服务
# 修改 mysql 配置文件 /etc/my.cnf,添加如下信息
[mysqld]
skip-grant-tables
# 重新启动 mysql 服务
# 免密登录
mysql -uroot
use mysql;
update user set password = password('123456'), authentication_string = password('123456') where user = 'root';
flush privileges;
# 停止 mysql 服务后,还原 /etc/my.cnf 配置文件后重启服务后,使用新密码登录即可
欢迎 【 留言 || 关注 || 打赏 】 。您的每一份心意都是对我的鼓励和支持!非常感谢!欢迎互加,相互交流学习!
作者:范丰平,本文链接:https://www.cnblogs.com/fengpingfan/p/13871665.html
Copyright @范丰平 版权所有,如需转载请标明本文原始链接出处,严禁商业用途! 我的个人博客链接地址:http://www.cnblogs.com/fengpingfan