Leif160519's blog Leif160519's blog

——————

目录
解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题
/    

解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题

方法一:

1.获取随机密码登录mysql:

sed -n '6p' /var/log/mysqld.log

2.修改level:

mysql>set global validate_password_policy=0;

3.设置密码最低长度:

mysql>set global validate_password_length=4;

4.修改密码:

mysql> ALTER USER USER() IDENTIFIED BY 'password';

或者用mysql_secure_installation进行安全设置

方法二:

1.停止MySQL服务

sudo service mysql stop

2.修改配置文件

sudo nano /etc/my.cnf

[mysqld]下面添加 skip-grant-tables

3.重启服务

sudo service mysql start

4.登录mysql

mysql>update mysql.user  set authentication_string=password('newpassword') where user=‘root';
mysql>flush privileges;
mysql>quit;

5.注解掉skip-grant-tables

6.重启服务

sudo service mysql restart

重新登录后执行从方法一第二部开始的所有操作步骤


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题
作  者Leif160519
出  处https://github.icu/articles/2019/08/30/1567129688347.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!