mysql5.7.9 密码过期

时间:2021-08-11 10:01:19

 mysql client 连接 报错:

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


发现是因为mysql 密码默认是90天过期。 所以需要重设密码,


1) mysql -uroot -ppassword

2) set password = password('newpassword')

3) ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;    -- 设置密码有效期为永久