美文网首页
mysql 1045(28000)问题处理(skip-gran

mysql 1045(28000)问题处理(skip-gran

作者: If_54ea | 来源:发表于2019-12-02 22:27 被阅读0次

    1)打开命令提示符,关闭MySQL服务:net stop mysql

    2)输入 :mysqld --console --skip-grant-tables --shared-memory

    3)保持当前窗口,另开新的cmd窗口,输入mysql,跳过密码登录,进入mysql

    4)修改密码 ,转载自https://blog.csdn.net/wolf131721/article/details/93004013

    MySql 从8.0开始修改密码有了变化,在user表加了字段authentication_string,修改密码前先检查authentication_string是否为空

    ①如果不为空

    use mysql;

    update user set authentication_string='' where user='root';--将字段置为空

    ALTER user 'root'@'localhost' IDENTIFIED BY 'root';--修改密码为root

    ②如果为空

    ALTER user 'root'@'localhost' IDENTIFIED BY 'root';--修改密码为root

    注意:

    如果出现如下错误

    ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

    mysql> GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY '123' WITH GRANT OPTION

    需要执行

    flush privileges;

    然后再执行

    ALTER user 'root'@'localhost' IDENTIFIED BY 'root';--修改密码为root

    相关文章

      网友评论

          本文标题:mysql 1045(28000)问题处理(skip-gran

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