SQL Server: “The password of the account has expired.”

This is the first time that I have come across this error. Today, while I was testing a web application on my local machine, Microsoft SQL Server began to throw the following exception whenever my web app attempted to connect to a database:

Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[28000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user ‘test’. Reason: The password of the account has expired.’

Apparently – user passwords on SQL Server will expire by default.

To fix the issue, you will need to login to Microsoft SQL Server Management Studio as an administrator and find the account in question. The account should be listed under Security -> Logins. After selecting the user account in question, you will see the following form:

enforce password expiration

In the screenshot above, you can see that the red arrow is pointing towards an option called “Enforce password expiration”, which has been ticked in this case. To remove the password expiration from the account, simply untick the checkbox and press “OK”.

Hopefully, this helped!