Your password does not satisfy the current policy requirements

Your password does not satisfy the current policy requirements

为了加强安全性,MySQL5.7要求一个复杂的密码
与validate_password_policy的值有关

Policy Tests Performed
0 or LOW Length
1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters
2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file

默认是1,即MEDIUM,所以刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符。
有时候,只是为了自己测试,不想密码设置得那么复杂,譬如说,我只想设置root的密码为123456。
必须修改两个全局参数:
首先,修改validate_password_policy参数的值

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)

然后 就可以修改成一个简单的密码了

猜你喜欢

转载自blog.csdn.net/zl_1079167478/article/details/80906582