问题描述:
#进入mysql.
queena@queena-lenovo:~$ mysql -u root -p
#在mysql中输入
mysql> grant all privileges on *.* to 'root'@'%' identified by 'pswd' with grant option;
#其中,'pswd'是你自己的mysql的密码,记得改下。
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements.
问题分析及解决方法:
密码太过简单,不符合密码设计要求。
S1.查看现有代码设计规则
SHOW VARIABLES LIKE 'validate_password%';
S2.修改策略
set global validate_password.policy=LOW;
set global validate_password.length=1;
其中,validate_password_policy取值:
0 or LOW 只验证长度;
1 or MEDIUM 验证长度、数字、大小写、特殊字符;
2 or STRONG 验证长度、数字、大小写、特殊字符、字典文件;
#设置完成后:可以再次输入查看命令进行查看:
SHOW VARIABLES LIKE 'validate_password%';
S3.修改mysql的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码';
至此,问题得以解决!