Change msde sa password and logon authentication mode

Source: Internet
Author: User
Tags mssqlserver strong password
Change msde sa password and logon authentication mode
Microsoft SQL Desktop Engine 2000 is a commonly used SQL-supported database, but its SA default password is blank after installation, which affects data security. Because msde2000 is a simplified version and does not have a console, you can only change the password in the command line mode. Steps:
Note that you must switch the SQL Authentication mode before changing the password through the command line. The default SQL Authentication mode is Windows Account mode. You must use SQL authentication instead.
To switch Windows Account Authentication Mode to SQL Authentication mode, follow these steps:
1. Stop MSSQLServer and all other related services (such as SQLServerAgent ).
2. Open the Registry Editor.
3. Find one of the following sub-items (depending on whether MSDE is installed as the default MSDE instance or as a named instance ):
HKEY_LOCAL_MACHINE // software // Microsoft // MSSQLServer
-Or-
HKEY_LOCAL_MACHINE // software // Microsoft SQL Server // <Instance name> // MSSQLServer //
4. In the right pane, double-click the loginmode subitem.
5. In the DWORD Editor dialog box, set the value of this subitem to 2. Make sure that the hex option is selected, and then click OK. (By default, the value of the Windows loginmode registry subitem is set to 1. If the SQL Authentication mode is enabled, this value is 2 .)
6. Restart the MSSQLServer and SQLServerAgent services for the change to take effect. So far, the SQL verification mode has been switched over.
7. Run the CMD command in the running menu to enter the command line mode.
8. Go to the MSDE installation directory c: // program files // Microsoft SQL Server // 80 // tools // binn
9. execute commands
Osql-U sa-Q "sp_password null,/'password/',/'sa /'"
(Change Password to the password you want to set. Note the format of single quotation marks and double quotation marks when entering the password)
10. Enter the default password and press Enter. The password is successfully modified.
After the password is changed, the usage is not affected. To change the password, follow the same steps. You can also use the command line to modify the SA password of SQL2000 Enterprise Edition and Professional Edition. (The premise is that you must know the SA password)

[This post was edited by the author at 17:33:35]
Author: Xiaotian 16:08:20)

How to verify that the SA password is empty

1. Open the Command Prompt window in the host computer of the MSDE instance you are connecting.
2. type the following command at the command prompt and press Enter:
Osql-U sa
In this way, you can connect to the local default instance of MSDE through the SA account. To connect to the named instance installed on your computer, type:
Osql-U sa-s servername // InstanceName
The following prompt appears:
Password:
3. Press enter again. This operation will pass a null (null) password to sa.
If the following prompt is displayed after you press enter, you do not have a password for the SA account:
1>
To meet the requirements of the security solution, Microsoft recommends that you create a non-empty strong password.
However, if you receive the following error message, the password 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 authentication only:
Login Failed for user/'sa/'. Reason: not associated with a trusted SQL server connection.
The SA password cannot be verified in Windows Authentication mode. However, you can create a SA password so that the SA account remains secure when the Authentication mode is changed to hybrid mode in the future.
If you receive the following error message, it indicates that SQL Server may not be running, or you may provide an error name for the name instance of the installed SQL Server:
[Shared Memory] SQL server does not exist or Access denied.
[Shared Memory] connectionopen (connect ()).

[This post was edited by the author at 17:32:02]
Author: Xiaotian 17:36:51)

Another simple method to change the SA Password

1. Open the Command Prompt window in the host computer of the MSDE instance you are connecting.
2. type the following command and press Enter:
Osql-U sa
At the password: prompt, press enter (if the password is empty) or enter the current password. In this way, you can use the SA account to connect to the local default instance of MSDE.
To use Windows authentication for connection, type the following command:
Use osql-e

3. type the following commands in each individual line and press Enter:

Sp_password @ old = NULL, @ new =/'password/', @ loginame =/'sa /'
Go

Note: Make sure to replace "password" with your password.
You will receive the following prompt, indicating that the password has been changed successfully:
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.