password recovery studio

PASSWORD UNLOCKER

Password Reset and Password Recovery Tools

How to reset sa password in MS SQL Server

Thursday, 3. December 2009

The sa account has full rights in the MS SQL Sever environment. When you install the MS SQL Server program, the sa account is created and sa password is default blank (NULL). You can also change the blank sa password to a strong one when the setup program is running.

How to verify if the SA password is blank

1 On the computer that is hosting the instance of MSDE to which you are connecting, open a command prompt window.

2 At the command prompt, type the following command, and then press ENTER:

osql -U sa

This connects you to the local, default instance of MSDE by using the sa account. To connect to a named instance installed on your computer type:

osql -U sa -S servername\instancename

You are now at the following prompt:

Password:

3 Press ENTER again. This will pass a NULL (blank) password for sa.

If you are now at the following prompt, after you press ENTER, then you do not have a password for the sa account:

1>

We recommend that you create a non-NULL, strong password to conform with security practices.

However, if you receive the following error message, you have entered an incorrect password. This error message indicates that a password has been created for the sa account:

“Login Failed for user ‘sa’.”

4 The following error message indicates that the computer that is running SQL Server is set to Windows Authentication only:

Login failed for user ‘sa’. Reason: Not associated with a trusted SQL Server connection.

5 You cannot verify your sa password while in Windows Authentication mode. However, you can create a sa password so that your sa account is secure in case your authentication mode is changed to Mixed Mode in the future.

If you receive the following error message, SQL Server may not be running or you may have provided an incorrect name for the named instance of SQL Server that is installed:

[Shared Memory]SQL Server does not exist or access denied.

[Shared Memory]ConnectionOpen (Connect()).

Or, you can install MS SQL Server Password Unlocker to check if the sa password is blank or not. Just one mouse click, you can view the result. Note that this program just identify .mdf file, and the sa password is saved in master.mdf which is usually at C:\Program Files\Microsoft SQL Server\MSSQL\Data\master.mdf

MS SQL Server Password Unlocker

MS SQL Server Password Unlocker

How to change your SA password

loadTOCNode(2, ‘summary’);

  1. On the computer that is hosting the instance of MSDE to which you are connecting, open the command prompt window.
  2. Type the following command, and then press ENTER:osql -U saAt the Password: prompt, press ENTER if your password is blank or type the current password. This connects you to the local, default instance of MSDE by using the sa account. To connect by using Windows authentication, type this command: use osql -ENote If you are using SQL Server 2005 Express, avoid using the Osql utility, and plan to modify applications that currently use the Osql feature. Use the Sqlcmd utility instead.For more information about the Sqlcmd utility, visit the following Microsoft Developer Network (MSDN) Web site:http://msdn2.microsoft.com/en-us/library/ms165702.aspx (http://msdn2.microsoft.com/en-us/library/ms165702.aspx)
  3. Type the following commands, on separate lines, and then press ENTER:
    sp_password @old = null, @new = ‘complexpwd’, @loginame =’sa’ go

    Note Make sure that you replace “complexpwd” with the new strong password. A strong password includes alpha-numeric and special characters, and a combination of upper and lower case characters.

    You will receive the following informational message, which indicates that your password was changed successfully:

    Password changed.

Besides, taking use of the third part tool to change sa password is also a good way. It is fast and easy. More refer: http://www.passwordunlocker.com/products/how_to_use_msspu.html

How to determine or change your authentication mode
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

If you are not sure how to verify the authentication mode of your MSDE installation, you can check the corresponding registry entry. By default, the value of the Windows LoginMode registry subkey is set to 1 for Windows Authentication. When Mixed Mode authentication is enabled, this value is a 2.

· The location of the LoginMode subkey depends on whether you installed MSDE as the default MSDE instance or as a named instance. If you installed MSDE as the default instance, the LoginMode subkey is located in the following registry subkey:

HKLM\Software\Microsoft\MSSqlserver\MSSqlServer\LoginMode

Note If you are using SQL Server 2005, whatever you installed a default instance or a named instance, locate the following registry subkey. MSSQL.x is a placeholder for the corresponding value for your system:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.x\MSSQLServer

· If you installed MSDE as a named instance, the LoginMode subkey is located in the following registry subkey:

HKLM\Software\Microsoft\Microsoft SQL Server\%InstanceName%\MSSQLServer\LoginMode

Note Before you switch authentication modes, you must set a sa password to avoid exposing a potential security hole.

To switch from Mixed Mode to Integrated (Windows) authentication, follow these steps:

1 To stop MSSQLSERVER and all other related services (such as SQLSERVERAgent), open the Services applet in Control Panel.

2 Open the Registry Editor. To open the Registry Editor, click Start, click Run, and then type: “regedt32″ (without the quotation marks)

Click OK.

3 Locate either of the following subkeys (depending on whether you installed MSDE as the default MSDE instance or as a named instance:

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlserver\MSSqlServer

4 Or HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\<Instance Name>\MSSQLServer\

5 In the right-pane, double-click the LoginMode subkey.

6 In the DWORD Editor dialog box, set the value of this subkey to 1. Make sure that the Hex option is selected, and then click OK.

7 Restart the MSSQLSERVER and the SQLSERVERAgent services for this change to take effect.

19 Responses to “How to reset sa password in MS SQL Server”



  1. tina Says:

    There are some other views about how to change sa password:
    The easiest way around this is to logon to the actual SQL Server NT machine itself as administrator. Then connect to SQL Server using any of the tools and specify “.” as the server name and ask for a trusted connection. As long as the admins group hasn’t been explicitly removed from having sa rights then you should connect ok and be able to reset the password.

    If you’re in mixed-mode and you know the NT userid of someone with sa rights, then get their password reset and logon/connect as them.

    Otherwise you can try and find a dba’s machine who already has the server registered to SQL EM with sa and use that copy of SQL EM to connect.

    If all these fail then you’ll have to rebuild master and disk reinit (6.x) or re-attach (7.x) all the user databases.



  2. How to Change SA Password or Other MS SQL Server Passwords? « Password recovery | Windows Password Recovery | SA Password Recovery | Internet Websites Password Recovery | Windows Live/MSN Password Recovery … Says:

    [...] 1: Access to master.mdf file, which is default at C:Program FilesMicrosoft SQL [...]



  3. Rosario Floch Says:

    Better regulations need to be placed on tactical body armor to guarantee the safety.



  4. how to speed up windows 7 Says:

    wow, great, I was wondering



  5. Three Ways to Reset SA Password! | Computer Programming Says:

    [...] 1: Access to master.mdf file, which is default at C:Program FilesMicrosoft SQL [...]



  6. Three Ways to Reset SA Password! — Computers Says:

    [...] 1: Access to master.mdf file, which is default at C:Program FilesMicrosoft SQL [...]



  7. how to fix registry errors Says:

    Easily, the article is really the sweetest topic on this registry related issue. I harmonize with your conclusions and will thirstily look forward to your incoming updates. Just saying thanks will not just be enough, for the fantasti c lucidity in your writing. I will immediately grab your rss feed to stay privy of any updates.



  8. Каталог статей Says:

    What words… super, a brilliant idea



  9. Каталог статей Says:

    The theme is interesting, I will take part in discussion. I know, that together we can come to a right answer.



  10. Каталог статей Says:

    In my opinion you are not right. I can prove it. Write to me in PM, we will communicate.



  11. Manhattan Real Estate Says:

    very interesting.



  12. Izetta Gauer Says:

    Very good writing. I am glad your posting that. I hope you can accept my apology for my less good English Skills, I am from France and English is sort of new to me. I will bookmark your blog and keep reading.



  13. NYC Apartments Says:

    very nice blog.



  14. Manhattan Rentals Says:

    interesting.



  15. online stock trading Says:

    Your blog is so informative … ..I just bookmarked you….keep up the good work!!!!

    Hey, I found your blog in a new directory of blogs. I dont know how your blog came up, must have been a typo, anyway cool blog, I bookmarked you. :)



  16. Tchibo Says:

    This is a best place for such kind of articles, your site is a inspiration for me. i got so very much benefits and great results after visiting here and the grace is increasing day by day in your posts. The above information is extremly essential.



  17. belavina Says:

    Nice article. Would be grateful for any other information concerning this topic. Thanks!



  18. HELAINE Says:

    I’ve been searching for a long time for this! Finally I found your site on Yahoo.

    Thanks.



  19. Dolly Says:

    Greatings, blog.passwordunlocker.com – da mejor. Guardar va!

Leave a Reply