ITPub博客

首页 > 数据库 > > MySQL安装后root密码为空导致不能进入数据库的处理方法

MySQL安装后root密码为空导致不能进入数据库的处理方法

作者:362931297 时间:2019-12-24 02:49:43 0 删除 编辑

在一些非常规安装时会遇到这个莫名其妙的问题:OS是Ubuntu,MySQL版本是5.7.26。

安装后MySQL的error log提示:[Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

解决:

# sudo mysql -uroot

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password;

mysql> alter user root@localhost identified with mysql_native_password as '*xxxxx';

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26950862/viewspace-3153611/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-19

  • 博文量
    6
  • 访问量
    34