mysql修改密码Your password does not satisfy the current policy requirements

mysql修改密码Your password does not satisfy the current policy requirements

安装
出现这个问题的原因是:密码过于简单。刚安装的mysql的密码默认强度是最高的,如果想要设置简单的密码就要修改validate_password_policy的值,

validate_password_policy有以下取值:
mysql修改密码Your password does not satisfy the current policy requirements_第1张图片

如果要修改这个值:

1、查看当前mysql默认密码

grep 'temporary password' /var/log/mysqld.log

2、先登入到mysql,创建数据库 提示错误。

mysql> create database cm default character set utf8;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

3、设置安全级别

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

4、默认密码长度为8,可以设置为其它值,最小4位

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

5、设置新密码,刚安装完的mysql必须设置新密码(应该是从5.5版本开始)

mysql> set PASSWORD=PASSWORD('password');
Query OK, 0 rows affected, 1 warning (0.00 sec)

你可能感兴趣的:(高版本mysql,修改密码)