Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I unlock the sa account on SQL SERVER 2005?

We have moved a database from SQL 2000 to a new SQL 2005 that is used with an intranet page to display and update data. We are now unable to login using the sa account as the settings for the page used the old login password and appears to have locked the sa account.

I guess using the sa account for this page was not such a great idea but still that does not help as we can not login to create a new one.

Is there a way to unlock the sa account without being able to login as sa?

like image 485
Swinders Avatar asked Dec 07 '22 08:12

Swinders


1 Answers

We could only login using Windows authentication by being on the actual server. Once we had worked this out we run the command:

ALTER LOGIN sa WITH PASSWORD = 'your_password_here' UNLOCK

in SQL management studio, corrected the login password in the web.config file and everything works.

Turns out that password policies are enforceable on SQL Server 2005 so repeated incorrect logins locked out the account.

like image 159
Swinders Avatar answered Jun 06 '23 09:06

Swinders