MySQL5.7出现Your password has expired. To log in you must change it using a client that supports expir

Posted wangmo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL5.7出现Your password has expired. To log in you must change it using a client that supports expir相关的知识,希望对你有一定的参考价值。

今天晚上本来想写bootstrap-fileinput插件集成fastdfs的文章,但是刚启动idea里面的QiYuAdmin就出现了错误: 
Your password has expired. To log in you must change it using a client that supports expired passwords.其实只需要修改密码就可以了,这个问题我找到了以下解决办法:

1、修改 /etc/my.cnf,在 [mysqld] 小节下添加一行:skip-grant-tables=1

这一行配置让 mysqld 启动时不对密码进行验证

2、重启 mysqld 服务:systemctl restart mysqld

3、使用 root 用户登录到 mysql:mysql -u root

4、切换到mysql数据库,更新 user 表:

update mysql.user set authentication_string=password(‘root’) where user=’root’ and Host = ‘localhost’;

flush privileges;

在之前的版本中,密码字段的字段名是 password,5.7版本改为了 authentication_string

5、退出 mysql,编辑 /etc/my.cnf 文件,删除 skip-grant-tables=1 的内容

6、重启 mysqld 服务,再用新密码登录。但此时还是不行哦,我以为可以了,就没有往下看了。其实还有最后一步。

7、alter user ‘root’@’localhost’ identified by ‘root’;

有个疑问,不知道为什么程序是一直链接不上的,但是客户端,比如Navcat和MySQL的WorkBench都是可以链接上的?最后一段我是直接在Navcat里面执行的


以上是关于MySQL5.7出现Your password has expired. To log in you must change it using a client that supports expir的主要内容,如果未能解决你的问题,请参考以下文章

mysql5.7 Your password does not satisfy the current policy requirements问题解决

mysql5.7密码过期ERROR 1862 (HY000): Your password has expired. To log in you must change

MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before execu

mysql5.7 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql5.7初始化密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement

Your password does not satisfy the current policy requirements解决办法