Has you may already know, in MySQL it is possible to set an expiration period for passwords.
It’s not always obvious to see when the password will expire. And most of the time if you don’t pay much attention you will get something like this:
ERROR 1820 (HY000): You must reset your password
ALTER USER statement before executing this statement.
Let me share you a small query that check for how long your
password is still valid in case it was created with an expiration
delay or if the global
default_password_lifetime is set