zoukankan      html  css  js  c++  java
  • Ubuntu20.04 安装 mysql8.0 之后 root 账户无法登录

    一、查看密码

    sudo cat /etc/mysql/debian.cnf
    

    二、利用 debian-sys-maint 账户登录Mysql

    mysql -udebian-sys-maint -p
    

    三、查看user表信息:

    use mysql;
    select user,host,authentication_string from user;
    

    可以明显看到,root账户存在但密码为空。

    四、修改密码:

    alter user 'root'@'localhost' identified with mysql_native_password by 'mysql'; # 修改密码为 mysql
    flush privileges; # 重新加载权限表
    

    五、退出mysql重新登录

    quit;
    mysql -uroot -p
    

  • 相关阅读:
    导论
    Array
    Singleton
    Bridge
    Mediator
    interpreter
    Visitor
    Flyweight
    Command
    Chain Of Responsibility
  • 原文地址:https://www.cnblogs.com/Noturns/p/13385481.html
Copyright © 2011-2022 走看看