修改root账户密码为“root”后,提示ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
MySQL5.7 加强了安全保障,以上意思是密码不符合安全策略要求,我们输入一个8位或以上长度,复杂一点的密码
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
可以通过命令如下命令修改密码:
alter user 'root'@'localhost' identified by 'xiaxiaoxu';
mysql> alter user 'root'@'localhost' identified by 'xiaxiaoxu';
Query OK, 0 rows affected (0.00 sec)
之后再运行就不会有问题了
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)