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

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._第1张图片

 

 

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.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天

              第二天:不验证有效期

              第三天:设置为默认值

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