When you set the user password in MySQL if you may gets an error like "ERROR 1819 (HY000): Your password does not satisfy the current policy requirements"
mysql> CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'your_password';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
Because of your password. Before set the user password you can see the "password validate configuration metrics" in your MySQL server using the command
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 |
+--------------------------------------+--------+
Another option is you can set the password policy level lower, so that we can set the validate_password to '0', the command is " SET GLOBAL validate_password_policy = 0;"
mysql> SET GLOBAL validate_password_policy = 0;
Query OK, 0 rows affected (0.00 sec)
Now, you are able to create a user name with password,
mysql> CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'your_password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'user_name'@'localhost' IDENTIFIED BY 'your_password';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Comments (0)