您的位置:首页 > 运维架构 > Linux

centos 7 mysql 忘记密码如何找回

2018-02-07 22:09 741 查看
修改 vim /etc/my.cnf 加上一句:skip-grant-tables

1.保存并且退出。重新启动mysqld

service mysqld restart

<
9f8f
/blockquote>

2.登录并修改MySQL的root密码

mysql

use mysql;

sql: update user set authentication_string=password(‘new password’) where user=’root;

3.执行 flush privileges;

4.退出mysql。

5.删除 skip-grant-tables

6.重启mysql
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: