美文网首页
mysql8.0无法更改root密码解决方法

mysql8.0无法更改root密码解决方法

作者: 含辞未吐气若幽兰 | 来源:发表于2022-11-07 18:20 被阅读0次

    mysql 8中,mysql.user 表中不再有字段:password,而是字段:authentication_string

    1 use mysql;

    2 update mysql.user set authentication_string='' where User='root';

    3 alter user 'root'@'localhost' identified with mysql_native_password by '新密码';

    4 flush privileges;

    有时候安装没有生成初始化密码,可以用mysqld --initialize --user=mysql --console ,控制台会打印出初始化密码

    相关文章

      网友评论

          本文标题:mysql8.0无法更改root密码解决方法

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