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

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,


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