1、问题

       使用MySQL5.7时,会遇到密码过期无法登陆的问题,显示1862-Your password has expired. To log in you must change it using a client that supports expired passwords.

 使用MySQL5.7时,会遇到密码过期无法登陆的问题,显示1862-Your password has expired. To log in you must change it using a client that supports expired passwords.

 

 

2、解决方法

       2.1 用mysql命令行登录mysql的root用户

 使用MySQL5.7时,会遇到密码过期无法登陆的问题,显示1862-Your password has expired. To log in you must change it using a client that supports expired passwords.

 

       2.2 重新修改root密码 

       SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

       注:newpass为需要设置的新密码

 此时已经解决掉了密码过期的问题

 

       2.3 设置参数default_password_lifetime来延长使用期限,并达到密码永久不过期

       输入如下命令语句:

            ALTER USER 'root'@localhost' PASSWORD EXPIRE INTERVAL 90 DAYS;
               ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
               ALTER USER 'root'@'localhost' PASSWORD EXPIRE DEFAULT;

              具体作用:

              第一句:有效期90天

              第二天:不验证有效期

              第三天:设置为默认值

相关文章:

  • 2022-12-23
  • 2021-10-02
  • 2021-08-03
  • 2021-10-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-06-02
  • 2021-09-07
  • 2021-11-13
相关资源
相似解决方案