Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you reset the SA password?

How on earth do you reset the sa password? I know how to go into the dialogs and reset a password. That's now what I'm asking about. It runs a little deeper than just click, click, new password, done!

I have no idea what the SA password is. Nor does the previous user of this machine. The previous user says he never had SQL Express ever running on this machine.

This journey started when I tried to create a new database and was told I didn't have permissions to do so. Okay, I decided to just give myself the appropriate permissions. Nope, I can't give myself nor anyone else permissions.

I tried changing the password using SSMS. I get a message saying I don't have permissions to change it.

I tried using the following SQL script. Again, no permissions.

GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
GO

The database is SQL Server 2008 Express (10.0.2531.0). SQL Server Management Studio is SSMS 2008. OS is Windows 7 Enterprise I'm a local admin, and a domain user. I created a local admin account for logging into SSMS Machine is on a domain. I have no problems connecting to our network database servers.

Any suggestions? This could be a simple fix. Thanks...

like image 678
DenaliHardtail Avatar asked Nov 15 '10 19:11

DenaliHardtail


People also ask

What is the default password for the sa login?

FYI, there is no "default" password for SQL Server's sa account. It gets setup during installation, by you. If you didn't specify mixed mode authentication, then SQL Server is running in Windows Authentication mode, which means you cannot login using sa and a password.


2 Answers

This should help: start SQL Server in single-user mode. This will allow local administrators to connect as a sysadmin fixed server role. A detailed description of how to do this can be found here.

like image 138
AlexS Avatar answered Nov 12 '22 01:11

AlexS


people also can try to change password this way by the below SP

EXEC sp_password NULL, 'yourpassword', 'sa'

hope may help other. thanks

like image 31
Mou Avatar answered Nov 12 '22 00:11

Mou