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

参考:https://oneinstack.com/question/1914/

忘记root密码更改方法:

service mysql restart

/bin/systemctl restart  mysql.service

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

原文:http://phpervip.blog.51cto.com/11075781/1919194

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值