码迷,mamicode.com
首页 > 数据库 > 详细

【mysql初始设置密码报错处理方法】ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

时间:2020-07-14 18:33:06      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:style   medium   text   rac   ali   --   check   upper   row   

设置密码:

mysql> set password for root@localhost = password(‘test123‘);                                                                                                  

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

直译报错:您的密码不符合当前的政策要求(密码初始验证策略要求)

查看mysql初始密码验证策略:

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)  
变量定义:
1、validate_password_check_user_name:验证密码检查用户名,非必须
2、validate_password_dictionary_file:验证密码字典文件,无要求
3、 validate_password_length:验证密码长度,8字符
4、validate_password_mixed_case_count:验证密码混合大小写,否
5、validate_password_policy:验证密码策略,中等
6、validate_password_special_char_count:验证密码特殊字符数,否
 
报错其实与validate_password_policy的值有关,validate_password_policy有以下取值:
Policy Tests Performe(要求)
0 or LOW Length
1 or MEDIUM numeric, lowercase/uppercase, and special characters
2 or STRONG Length; numeric, lowercase/uppercase, and special characters

默认是1,即MEDIUM,所以刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符。
解决办法:
简单2步即可解决,修改验证密码相关数据以支持简单密码设置:
mysql> set global validate_password_length=6;                                                                                                                   
Query OK, 0 rows affected (0.00 sec)                                                                                                                            
                                                                                                                                                                
mysql> set global validate_password_policy=0;                                                                                                                   
Query OK, 0 rows affected (0.00 sec)                                                                                                                            
                                                                                                                                                           
mysql> set password for root@localhost = password(‘test123‘);                                                                                                   
Query OK, 0 rows affected, 1 warning (0.01 sec)
设置密码成功。

【mysql初始设置密码报错处理方法】ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

标签:style   medium   text   rac   ali   --   check   upper   row   

原文地址:https://www.cnblogs.com/Tanwheey/p/13300144.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!