PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords
Posted by: DjWelitu (---.dsl.telesp.net.br)
Date: March 13, 2017 08:19PM

Hello!
I tried to log in my website on my Wampserver, and i got the following message.
PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords. in lock_may_be_available()

By what i've noticed is something related with MySQL that expired my password. Now i can't log on my db. Can anyone help me and/or provide me an URL that is related with this problem?

I've tried run mysql on command prompt and it looks like MySQL doesn't even exists!

I'm still learning about web developing, so i would like to ask some patience.

Thanks in advance! winking smiley



Edited 1 time(s). Last edit at 03/13/2017 08:43PM by DjWelitu.

Options: ReplyQuote
Re: PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords
Posted by: Otomatic (Moderator)
Date: March 13, 2017 09:16PM

Hi,

Answer tomorrow. I know how to reset password.
Explanations are on my PC. Now I use Smartphone, not at home where is my PC

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords
Posted by: DjWelitu (---.dsl.telesp.net.br)
Date: March 13, 2017 09:54PM

Hello Otomatic! Oh, that's good news!
Well, that would help a lot! I'm a little desperate here, but i can wait until tomorrow.
I don't even know where to start, Just saying that you can help me makes me less desperate! haha

Thanks and i'll wait till tomorrow! winking smiley

Options: ReplyQuote
Expired password for MySQL 5.7.4 to 5.7.10
Posted by: Otomatic (Moderator)
Date: March 13, 2017 10:10PM

Expired password for MySQL 5.7.4 to 5.7.10

The limited password life problem only occurs for versions of MySQL between 5.7.4 and 5.7.10 included (*):
Excerpt from documentation MySQL
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.
This is due to the behavior of the variable "default_password_lifetime" which by default (that is even if it does not exist in the my.ini file) is:
- from MySQL 5.7.4 to 5.7.10 inclusive: 360 is a year
- from MySQL 5.7.11: 0 is no limitation
When the password is expired, we have error:
#1862 - Your password has expired. To log in you must change it using a client that supports expired passwords.
mysqli_real_connect(): (HY000/1862): Your password has expired. To log in you must change it using a client that supports expired passwords.
We will be able to give a new password to root and to do this, we will use the MySQL Console.

- Open MySQL Console
Left-Click Wampmanager tray icon -> MySQL -> MySQL Console
At the prompt Enter password: just type Enter key.
We will now assign a new password to root, even if there were none before.
- In the MySQL Console, type (With Enter key at the end):
--- Note : Replace newpassword by the password you want.
--- This can be the same password that you had before.
mysql> ALTER USER USER() IDENTIFIED BY 'newpassword';
Query OK, 0 rows affected (0.00 sec)
Then, still in the MySQL console do not set the password to a period of validity:
mysql> ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)
Exit the MySQL console

(*) For MySQL versions after 5.7.10 (So from 5.7.11), it is necessary to explicitly declare a lifetime of the passwords, otherwise there is no limitation.



Edited 1 time(s). Last edit at 01/11/2021 11:15AM by Otomatic.

Options: ReplyQuote
Re: PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords
Posted by: DjWelitu (---.dsl.telesp.net.br)
Date: March 13, 2017 10:53PM

Hi!

It worked without a hitch, Oto!
Thank you very much for your help!
May i edit this post as [SOLVED] so other newbies like me can follow your steps as they come across the same problem?



Edited 1 time(s). Last edit at 03/13/2017 10:54PM by DjWelitu.

Options: ReplyQuote
Re: PDOException: SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords
Posted by: arnb (---.dyn.optonline.net)
Date: April 02, 2017 09:59PM

This thread just saved me from a nightmare!
Thank you, Thank you, Merci Beaucoup!

Options: ReplyQuote


Sorry, only registered users may post in this forum.