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

安装mysql8后,本地登录成功,选择数据库报错

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

 

解决办法: 

执行语句修改密码:set password='新密码';


如果密码符合Mysql要求,会修改成功。如果出现以下错误信息:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
执行如下两条语句:
set global validate_password.policy=0;
set global validate_password.length=1;
然后再次执行 set password='新密码'; 即可。

posted @ 2023-03-27 12:46  leihongnu  阅读(80)  评论(0编辑  收藏  举报