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

793 阅读1分钟

linux操作mysql一直提示

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

首先,修改validate_password_policy参数的值

mysql> set global validate_password_policy=0;

Query OK,0 rows affected (0.00 sec)

validate_password_length(密码长度)参数默认为8,我们修改为1

mysql> set global validate_password_length=1;

Query OK,0 rows affected (0.00 sec)

完成之后再次执行修改密码语句即可成功

mysql> alter user 'root'@'localhost' identified by '123456';

Query OK,0 rows affected (0.00 sec)

授权远程访问

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
show databses;才有反应

在这里插入图片描述