授权用户时报错,ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
原因为其实与validate_password_policy的值有关
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.00 sec)
发现validate_password_policy为MEDIUM
参数说明
validate-password=ON/OFF/FORCE/FORCE_PLUS_PERMANENT: 决定是否使用该插件(及强制/永久强制使用)。
validate_password_dictionary_file:插件用于验证密码强度的字典文件路径。
validate_password_length:密码最小长度。
validate_password_mixed_case_count:密码至少要包含的小写字母个数和大写字母个数。
validate_password_number_count:密码至少要包含的数字个数。
validate_password_policy:密码强度检查等级,0/LOW、1/MEDIUM、2/STRONG。
validate_password_special_char_count:密码至少要包含的特殊字符数。
关于validate_password_policy-密码强度检查等级:
执行以下操作就可以了
mysql> set global validate_password_policy=0;
Query OK,0 rows affected (0.00sec)
mysql> show global variables like "validate_password_policy";+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| validate_password_policy | LOW |
+--------------------------+-------+
1 row in set (0.01 sec)
参考
解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题 - CSDN博客 https://blog.csdn.net/maxsky/article/details/51171474
MySQL-5.7密码策略及用户资源限制 - BXBZ—边学边做 - 博客园 https://www.cnblogs.com/tongxiaoda/p/7873478.html
mysql出现ERROR 1819 (HY000)的解决方法 - CSDN博客 https://blog.csdn.net/xyajia/article/details/77096974