美文网首页
MySQL5.7 重置密码

MySQL5.7 重置密码

作者: 南风nanfeng | 来源:发表于2018-11-30 16:06 被阅读5次
  1. 编辑配置文件my.cnf
    添加一行如下:

skip-grant-tables

  1. 重启MySQL

service mysqld restart

  1. 登入MySQL并修改密码

mysql
update mysql.user set authentication_string=password('新密码') where user='root';
flush privileges;
exit;

  1. 去掉skip-grant-tables这行,并重启MySQL即可。

相关文章

网友评论

      本文标题:MySQL5.7 重置密码

      本文链接:https://www.haomeiwen.com/subject/ccmhcqtx.html