views:

3736

answers:

6

I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?

EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.

A: 

Unless you set it up to only accept SQL Server authentication, you can log on with integrated security using the administrator user of the domain and/or machine.

Lasse V. Karlsen
Not necessarily, if the local admin user or group wasn't added as an admin at install, this isn't an option. Also, SQL Authentication by itself isn't an option.
RobS
+5  A: 

Try running the following commands at the command prompt (assuming your Server name is SQLEXPRESS):

osql -E -S .\SQLEXPRESS
exec sp_password @new='changeme', @loginame='sa'
go
alter login sa enable
go
exit

Once you have completed these steps, try to login with username sa and password changeme.

cowgod
I think this first command requires integrated account. Since when I try it, it says "Login failed for user 'mydomain\myuser'".
thanks a lot.+(15 chars)
Behrooz
+1  A: 

Thanks a lot cowgod

It works Fine. I have Logged in to SQL Server with windows authentication mode. Then opened a new query window. There I typed these two commands by prssing F5.

First run exec sp_password @new='changeme', @loginame='sa'

Then alter login sa enable

So you can accept it as an answer.
Mendy
A: 

 

I used MS SQL Server Password Unlocker to reset SQL password when I forgot the MS SQL password a few days ago. I took two days to find a capable solutions but arrive no result. Fortunately, one of my class mates recommended me to reset the sql password with MS SQL Server Password Unlocker ; it is fast and easy to use, but no data

+1  A: 

You don't need to pay for any reset tools to do this. Start the instance in single user mode and you can create a new login with sysadmin permissions/

See this Pinal Dave link.

Chris W
Yup, that's how I did it: http://serverfault.com/questions/120215/user-provisioning-tool-for-sql-server-2008
RobS
A: 

Command prompt can change lost sa password.

Step 1. Open a command prompt (Start -> Run -> cmd)

Step 2. Type the follow commands, and press Enter after each line:

Osql -S yourservername -E

1> EXEC sp_password NULL, 'yourpassword', 'sa'

2> GO

This article is given 4 methods to change sql server password, that could help.