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

 

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '111';    
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

 

緣由是由於MySQL有密碼設置的規範,具體是與validate_password_policy的值有關:html

 

  MySQL完整的初始密碼規則能夠經過以下命令查看:mysql

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)

 

解決方法:sql

mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;

這樣就能夠設置簡單的密碼了。ui

 

 

參考:spa

https://www.cnblogs.com/nicknailo/articles/8563737.htmlcode

相關文章
相關標籤/搜索