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

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.0.8 32 bit - Apache 2.4.25 - PHP 7.1.3/7.0.17/5.6.30 - MySQL 5.7.17 - MariaDB 10.1.21
Wampserver 3.0.8 64 bit - Apache 2.4.25 - PHP 7.1.3/7.0.17/5.6.30 - MySQL 5.7.17 - MariaDB 10.1.22
PhPMyAdmin 4.6.6 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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
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 10:10PM

Hi,

I came home sooner than expected!

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.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.0.8 32 bit - Apache 2.4.25 - PHP 7.1.3/7.0.17/5.6.30 - MySQL 5.7.17 - MariaDB 10.1.21
Wampserver 3.0.8 64 bit - Apache 2.4.25 - PHP 7.1.3/7.0.17/5.6.30 - MySQL 5.7.17 - MariaDB 10.1.22
PhPMyAdmin 4.6.6 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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


Sorry, only registered users may post in this forum.