1.编辑/etc/my.cnf添加如下内容

2.启动mysql服务
systemctl start mysqld.service
3.进入mysql
mysql
4.键入下面的命令更新密码
设置root用户密码
update mysql.user set authentication_string=password(‘123456’) where user=‘root’;
5.更新一下
flush privileges;
6.重启mysql服务
systemctl restart mysqld.service
7.用更改过的用户名密码登录mysql
mysql -uroot -p123456
最后
以上就是欢喜心情最近收集整理的关于mysql更新密码的全部内容,更多相关mysql更新密码内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复