Change MSDE sa password and logon authentication mode

Source: Internet
Author: User
Tags command line empty microsoft sql server connect mssqlserver strong password

Change MSDE sa password and logon authentication mode
Microsoft SQL Desktop Engine 2000 is a commonly used SQL support database, but the default password for its SA is empty after installation, which has a certain impact on data security. Because MSDE2000 is a simplified version, no management console, the password can only be changed to the command line mode. Step:
Note that the command line modifies the password before you switch the SQL authentication mode. The default method of SQL authentication is the Windows account mode, which is to be replaced with SQL authentication.


To switch to the authentication mode of SQL in Windows Account authentication mode, follow these steps:
1. Stop MSSQLServer and all other related services (such as SQLServerAgent) first.
2. Open Registry Editor.
3. Locate one of the following two subkeys (depending on whether MSDE was installed as the default MSDE instance or installed as a named instance):
Hkey_local_machine\\software\\microsoft\\mssqlserver\\mssqlserver
Or
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL server\\<instance name>\\mssqlserver\\
4. In the right pane, double-click the LoginMode subkey.
5. In the DWORD Editor dialog box, set the value of this subkey to 2. Make sure the HEX option is selected, and then click OK. (By default, the value of the Windows LoginMode registry subkey is set to 1.) This value is 2 if the SQL authentication mode is enabled. )
6. Restart the MSSQLServer and SQLServerAgent services for the changes to take effect. At this point, the SQL verification mode has been switched off.
7, in the Run menu to execute CMD command first into the command line mode
8, access to MSDE installation directory C:\\Program Files\\Microsoft SQL Server\\80\\tools\\binn Directory
9. Execute the Order
Osql-u sa-q "sp_password NULL, \ ' password\ ', \ ' Sa\ '"
(where password changes to the password you want to set, note the form of single and double quotes when you enter)
10, you will be prompted to enter the default password, directly press ENTER. Password modification succeeded.
The password does not affect use after it has been modified. If you want to change the password step ibid. This method can also be used to modify the SQL2000 Enterprise and Professional version of the SA password with the command line. (If you must know the sa password OH)

How to verify that the SA password is empty

1. In the host computer where you are connecting to the instance of MSDE, open a command Prompt window.
2. At the command prompt, type the following command, and then press Enter:
Osql-u SA
This allows you to connect to the local default instance of MSDE through the SA account. To connect to a named instance that is installed on your computer, type:
Osql-u sa-s Servername\\instancename
The following prompts appear:
Password:
3. Press the Enter key again. This will pass a NULL (null) password for the SA.
If you press Enter and you receive the following prompt, you do not have a password for the SA account:
1>
To meet the security requirements, Microsoft recommends that you create a strong password that is not empty.
However, if you receive the following error message, the password that you entered is incorrect. This error message indicates that a password has been created for the SA account:
"Login Failed for user \ ' Sa\ '."
The following error message indicates that the computer running SQL Server is set to Windows-only authentication:
Login failed for user \ ' Sa\ '. Reason:not associated with a trusted SQL Server connection.
The SA password cannot be validated in Windows authentication mode. However, you can create an SA password so that the SA account remains secure when it is changed to mixed mode later in the authentication mode.
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 the installed SQL Server:
[Shared Memory] SQL Server does not exist or access denied.
[Shared Memory] ConnectionOpen (Connect ()).

Another simple way to change the sa password

1. In the host computer where you are connecting to the instance of MSDE, open a command Prompt window.
2. Type the following command, and then press Enter:
Osql-u SA
At the Password: prompt, press Enter (if the password is blank) or type the current password. This allows you to connect to the local default instance of MSDE using the SA account.
To connect using Windows authentication, type this command:
Use OSQL-E

3. Type the following commands in each individual line, and then press Enter:

Sp_password @old = null, @new = \ ' password\ ', @loginame =\ ' sa\ '
Go

Note: Be sure to replace "password" with your password.
You will receive the following message indicating that your password was successfully changed:
Password changed.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.