由于mysql root密码默认为空,为了我的mysql数据库的安全,我决定为其创建一个密码。我尝试使用以下命令更改 root 密码:
sudo mysqladmin -u root -p password
在尝试更新密码后,它给了我这个警告和错误:
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety. mysqladmin: unable to change password; error: 'Your password does not satisfy the current policy requirements'
我该怎么办?
请点击图片链接。
最佳答案
它告诉您无法设置您选择的密码,因为它的强度不足以满足策略要求。策略级别通过系统变量validate_password_policy
进行配置,其作用如下:
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
(长度测试是 validate_password_length
的值。)
看起来默认级别为 MEDIUM,默认长度为 8,因此您需要一个至少包含数字和特殊字符的混合大小写密码。
所以,要么:
- 降低配置中的测试强度,或者
- 选择更强的密码(推荐)。
关于Fedora 中无法更改 mysql root 密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41630544/