mysql 1862_MySQL 1862 - Your password has expired 解决方案

今天一台 windows 服务器上的程序异常,通过排查了解到是 MySQL 的密码过期了。报错信息如下:

format,png

英文 ERROR 我都写下来了,方便小伙伴们百度,哈哈......

1862 - Your password has expired. To log in you must change it using a client that support expired password.

以下是我网上搜索到的一些解决方法

update mysql.user set password_expired='N' where user='root';

update mysql.user set password=password("123456") where user='root'

update mysql.user set authentication_string=password('123456') where user='root' ;

update user set host = '%' where host = 'oracle' and user = 'root';

然而...并没有什么卵用(对于我当前的情况,也许对别的情况有用也说不定呢~~)

下面就来说说我的解决方法

1.ctrl+R 输入cmd 打开命令提示符

format,png

2.输入mysql -uroot -p (若提示mysql命令不可用,请到安装目录Bin下执行)

format,png

3.输入密码登录

format,png

4.修改登录密码,若有需要再次执行改回原密码

set password = password('123456')

format,png

5.连接测试,连接成功~~

format,png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值