如果在Mysql使用过程中,报如下错误:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
这是因为Mysql5.7版本引入了一个mysql的root密码安全策略,也就是需要重新设置一下root的密码
使用下面的命令更mysql的root密码:
root@localhost [(none)]> alter user 'root'@'localhost' identified by '1qaz@WSX';
刷新权限
root@localhost [(none)]> flush privileges;
再次执行命令就不会报错了
root@localhost [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)