当前位置:Gxlcms > 数据库问题 > 用oneinstack安装的mysql忘记密码后怎么办?

用oneinstack安装的mysql忘记密码后怎么办?

时间:2021-07-01 10:21:17 帮助过:31人阅读

             

2)用mysql命令登陆,注意,只有这5个字符,不带其它东西。
3)更改到mysql这个数据库use mysql
4)使用update命令更改 update user set password=password(‘new_password’) where user=’root’;

mysql5.7版本:

update mysql.user set authentication_string=password(‘test123‘) where user=‘root‘ and Host = ‘localhost‘;

5)成功后,使用flush privileges;刷新一下即可。别忘记把my.cnf里的skip-grant-tables前加“#”,

再restart mysql一下。


或者grep dbrootpwd /root/oneinstack/options.conf



用oneinstack安装的mysql忘记密码后怎么办?

标签:mysql root 密码

人气教程排行