美文网首页
修改/忘记root 密码 -mysql5.7

修改/忘记root 密码 -mysql5.7

作者: 知孺 | 来源:发表于2018-03-05 16:42 被阅读0次

    1.再 my.cnf 配置文件追加:

    skip-grant-tables

    skip-networking

    2.重启mysql 服务 serive mysql restart

    3.输入mysql -uroot 进入到命令行

    4.使用命令行修改

    update mysql.user set authentication_string=password('你的密码');

    5.继续输入:FLUSH PRIVILEGES;

    6.使用exit; 退出。然后注释掉my.cnf 中的

    #skip-grant-tables

    #skip-networking

    7.重启mysql服务

    相关文章

      网友评论

          本文标题:修改/忘记root 密码 -mysql5.7

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