MySQL 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

系统版本:macOS Sierra 10.12
MySQL版本:5.7.16

从官网下载的 dmg 安装包,安装完成后,使用自动生成的密码登陆 MySQL,执行:

show databases 

报错如下:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

报错提示告诉我们,需要重新设置密码。那我们就重新设置一下密码,命令如下:

set password = password('123456');

这次,我们在再次执行 show databases 就没有问题了。

MySQL 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement_第1张图片
2AADB416-4F1D-48CD-9ED7-02128FEC823E.png

附官网资料地址: https://dev.mysql.com/doc/refman/5.6/en/alter-user.html

你可能感兴趣的:(MySQL 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement)