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

This is the first time that I have come across this error.

Today, I was testing a web application on my local machine when Microsoft SQL Server started to throw the following exception:

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 this 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, you will see the following form:

enforce password expiration

A screenshot of Microsoft SQL Server Management Studio.

In the screenshot above, you can see that the red arrow is pointing towards an option called “Enforce password expiration”.

By default, the account will have this enabled.

To remove the password expiration from the user, you will need to untick this checkbox and then press “OK”.