MySQL 8.0 set up a simple password error message appears: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
As shown below:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Why set up a simple password, it is not unsafe? Because my test server within the network access, do not want to set a complex password, just like a simple point passwords such as root, 123 and so on.
But the new version of MySQL 8.0 added password security detection mechanisms, resulting in an error.
Solutions are as follows
1, view the current security variable values, view the available commands validate_password password authentication plug-in is installed.
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| 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.02 sec)
Validate_password_length minimum password length (if the minimum value 4).
Validate_password_number_count minimum number of digits in the password.
validate_password_mixed_case_count minimum number of sensitive.
Validate_password_special_char_count minimum number of special characters.
validate_password_dictionary_file dictionary file
MySQL 8.0 above is this:
validate_password.check_user_name ON
validate_password.dictionary_file
validate_password.length 8
validate_password.mixed_case_count 1
validate_password.number_count 1
validate_password.policy
validate_password.special_char_count 1
Global variable name has changed!
2. Modify the variable
. "" Noticed 8.0 vs 5.7 with more variable results in only half the setting is not enough, in order to use simple passwords in a higher version, you need to do this setting:
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)
Then execute the following command to set new simple password is OK
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.02 sec)
conclusion of issue
By looking at MySQL5.7 and MySQL8.0 password authentication plug-in contrast, shows two versions, the name is not the same. (* _Password_policy and * _password.policy) --- cause of the problem lies.