mysql 连接登录错误your password has expired ,to log in you must change it using a client that supports ex

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.


your password has expired ,to log in you must change it using a client that  supports expired passwords


您的密码已经过期,要登录您必须使用一个客户端来更改它。

支持密码到期

解决错误方法

1.在my.cnf  mysqld 部分加入 skip-grant-tables 参数。

[mysqld]
skip-grant-tables

2.重启mysql数据库,然后登陆


3.查看mysql的用户状态

>select host,user,password_expired,account_locked from mysql.user;
+-----------+-----------+------------------+----------------+
| host      | user      | password_expired | account_locked |
+-----------+-----------+------------------+----------------+
| localhost | root      | Y                | N              |
| localhost | mysql.sys | N                | Y              |
+-----------+-----------+------------------+----------------+
3 rows in set (0.00 sec)

password_expired :y说明密码已经过期,可以改成N,就是未过期

>update mysql.user set password_expired='N';
Query OK, 1 row affected (0.03 sec)
Rows matched: 2  Changed: 1  Warnings: 0


4.然后注释掉skip-grant-tables参数

重启mysql,用过期的密码就可以登陆了,登陆之后可以用下面的命令修改密码
>alter user user() identified by '123456';
Query OK, 0 rows affected (0.03 sec)

>flush privileges;
Query OK, 0 rows affected (0.03 sec)


  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误意味着你的密码已经过期了,为了登录你必须使用支持过期密码的客户端进行修改[1]。 这个错误通常发生在使用MySQL时,当你的密码已经过期,系统会要求你修改密码才能登录。解决这个问题的方法是执行一些命令来创建日志文件并改变文件的所有者,然后使用支持过期密码的客户端来修改密码。这个问题的原因可能是在安装MySQL过程中,通过mysqld –initialize命令生成临时密码后,没有直接进行MySQL的设置导致的。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [your password has expired.To log in you must change itusing a client that supports expired passwords](https://blog.csdn.net/fenniang16/article/details/81216602)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [MySQL安装手册](https://blog.csdn.net/qq_41244651/article/details/129028912)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [ERROR 1862 (HY000): Your password has expired. To log in you must change it using a …..](https://download.csdn.net/download/weixin_38672731/14838020)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值