【MySQL5.7】ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

[root@bogon ~]# mysql -uroot -pte1sFzFq5h#i
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.30

ERROR:

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123' PASSWORD EXPIRE NEVER;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> alter user 'root'@'localhost' identified by 'pwd123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> flush privileges;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

解决:

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)

mysql>  alter user 'root'@'localhost' identified by 'pwd123';
Query OK, 0 rows affected (0.00 sec)

猜你喜欢

转载自blog.csdn.net/qq_39591494/article/details/105999446