Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot login to phpmyadmin error #1862 - Your password has expired

I installed mysql, php and phpmyadmin following this tutorial. Evrything works well, i.e., I can start and connect to mysql through the command line without any error, but the problem is when I try to login to phpmyadmin, I receive this error:

#1862 - Your password has expired. To log in you must change it using a client that supports expired passwords.

It might worth saying that my current mysql password is not the temporary one that I received when I installed mysql, but I changed it later (before installing phpmyadmin), and now trying to login to phpmyadmin with this new (current) password shows me the above error.

Could someone please help me understand what is the problem?

Thanks

like image 612
mOna Avatar asked Mar 14 '16 18:03

mOna


People also ask

How do you login to phpMyAdmin?

You should be able to access phpMyAdmin directly, by browsing to http://127.0.0.1/phpmyadmin. Log in to phpMyAdmin by using the following credentials: Username: root. Password: The same as the application password.

How do I login as root in phpMyAdmin?

Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin. Log in to phpMyAdmin by using the following credentials: Username: root.

How do I get phpMyAdmin to work?

A: To start the phpMyAdmin, type in the URL: http://{your-ip-address}/phpmyadmin/index.php and login using the MySQL root/admin username and password.


2 Answers

Ok, finally I did not understand what was the reason for this issue, but the following solution worked for me:

  1. Enter this in terminal (in /usr/local/mysql/bin/) mysqladmin -u root -p password
  2. Enter your password
  3. Enter New password

  4. Done! I could then login from phpmyadmin too!

Hope it help others who have similar problem,

like image 97
mOna Avatar answered Sep 25 '22 02:09

mOna


MySQL password has expired

From MySQL 5.7.4 the default value for default_password_lifetime is 360 (a year). If you make no changes to this variable or individual user accounts, all user passwords expire after 360 days (so you get: "Your password has expired. To log in you must change it using a client that supports expired passwords").

To prevent automatic password expiry, log in as root (mysql -u root -p):

For clients that automatically connect to the server (e.g. from scripts.) change the password expiration settings:

ALTER USER 'script'@'localhost' PASSWORD EXPIRE NEVER;

or you can disable auto-password-expiry for all users:

SET GLOBAL default_password_lifetime = 0;

Links I used to understand and fix this

MySQL: Password Expiration and Sandbox Mode
MySQL: Password Expiration Policy
Password expiration policy in MySQL Server 5.7

like image 43
Dave Everitt Avatar answered Sep 23 '22 02:09

Dave Everitt