SQL Server sa password reset!!!

Recently I have changed the network from Domain to Workgroup.

Then I removed the domain controller.

 

Today I just realized that I could not create a database on my PC's SQL Server 2008 Express.

It said that I have no permission to do it. Hey, I have administrative permissions!!

 

Then I figured out that the local users were not registered on the SQL Server 2008. Besides I did not want to think of complex password and used "Windows Authentication Mode".

 

Here's what I did.

1.Change the SQL server's authentication mode to "Mixed"

ref: http://blogs.wankuma.com/route/archive/2008/06/12/143047.aspx (Japanese site)

  1a. Open Registry Editor and open "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQLServer"

  1b. Change the value of "LoginMode" to "2" which means Mixed Mode.

 

2.Restart the SQL Server in "Single User Mode"

ref: http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/

  2a.Open Server Contoller applet and modify the startup parameter of SQL Server Service.

  2b.add '-m;' before the other parameters.

  2c.Then restart the SQL Server Service.

 

Now you can log in to the SQL server with your windows account and have all permission you need!!

 

So I first added myself as localuser to SQL Server's user.

Then I changed the password of 'sa'.  Ah, don't forget to enabled the user as well.

 

Thank you Pinal Dave and WANKUMA! You saved my day!!!