ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

1、MySQl创建用户报错

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

 2、查看密码策略

mysql> SHOW VARIABLES LIKE 'validate_password%'; 
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.01 sec)

3、修改密码策略

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

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

再次查看

mysql>  SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password_check_user_name    | OFF   |
| validate_password_dictionary_file    |       |
| validate_password_length             | 4     |
| validate_password_mixed_case_count   | 1     |
| validate_password_number_count       | 1     |
| validate_password_policy             | LOW   |
| validate_password_special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.01 sec)

4、重新创建

mysql> create user 'jack'@'192.168.11.203' identified by '1234';
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host from mysql.user;
+---------------+----------------+
| user          | host           |
+---------------+----------------+
| jack          | 192.168.11.203 |
| mysql.session | localhost      |
| mysql.sys     | localhost      |
| root          | localhost      |
| tom           | localhost      |
+---------------+----------------+
5 rows in set (0.00 sec)

 

posted @ 2023-12-29 08:59  中仕  阅读(34)  评论(0编辑  收藏  举报