20 Kasım 2016 Pazar

java.sql.SQLException: Your password has expired. To log in you must change it using a client that supports expired passwords.

*** To clarify the issue, I can give the reason that causes this exception of MySQL (https://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.html);

"From MySQL 5.7.4 to 5.7.10, the default default_password_lifetime value is 360 (passwords must be changed approximately once per year). For those versions, be aware that, if you make no changes to the default_password_lifetime variable or to individual user accounts, all user passwords will expire after 360 days, and all user accounts will start running in restricted mode when this happens. Clients (which are effectively users) connecting to the server will then get an error indicating that the password must be changed: ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement."
*** How can we handle it;
Open the terminal, reach the directory that has mysql.exe (usually at C:\Program Files\MySQL\MySQL Server 5.7\bin) and typed:
mysql -u root -p
After this, you will realise that you cannot use "ALTER" command to change password. Because your password is expired and actions allowed are limited on this process. Here is the solution to reset the password on this screen;
SET PASSWORD = PASSWORD('xxxxxxxx');
*** Further upgrade after reseting the password (https://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.html); 
"To avoid having such clients suddenly stop working due to a password expiring, make sure to change the password expiration settings for those clients, like this:
ALTER USER 'script'@'localhost' PASSWORD EXPIRE NEVER
Alternatively, set the default_password_lifetime variable to 0, thus disabling automatic password expiration for all users."

Hiç yorum yok:

Yorum Gönder