Document directory
- Do not use the preceding statement to change the SA account password (PS)
1. log in with Windows Authentication
Manage studio -- menu "file" -- "Connect object Resource Manager", select "Windows authentication (Windows Authentication)" for authentication )"
2. After the connection is successful, right-click your instance (that is, user/sqlexpress) and select "properties"
3. in the "properties" window, go to "security", set "SQL Server and Windows Authentication Mode" in "Server Authentication", OK, as prompted, you should restart the SQL service.
4. After the SQL service is restarted, verify the connection by using Windows identity, execute the following statement to enable the SA user, clear the SA password, and change it to sa12345.
Right-click an instance and choose create query. Enter the following code and click "! Run"
EXEC sp_password null,sa12345,'sa'ALTER LOGIN sa ENABLE
Here, the first null is to clear the password, the second is the new password, and the third is the username "sa ".
Do not use the preceding statement to change the SA account password (PS)
Use SSMs to connect to the database, open security-> login-> Sa-> propertities, and modify the properties directly, as shown in:
5. After the statement is executed, use SA to connect to your instance.
Note: After the configuration is complete, I still cannot log in with SA. After I restart my computer, I can log in with SA again.
PS: 2012-7-3
When I log on to SQL Server 2012 using SA today, the following error occurs:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory provider, error: 0-No process is on the other end of the pipe .) (Microsoft SQL Server, error: 233)
The cause of the preceding error is that the Protocol is not enabled. Enable sqlserver Configure Manager and enable the TCP/IP and named piped protocols in sqlserver network configuration, as shown in:
After the preceding two protocols are enabled, log on again using the SA user and the following error occurs:
Login Failed for user 'username'. the user is not associated with a trusted SQL server connection. (Microsoft SQL Server, error: 18452)
This error is the "this user is not associated with a trusted SQL server connection" error mentioned in the title of this article. Follow the previous method to perform this operation again. Note that the "SQL Server and Windows Authentication" mode must be enabled.
PS:
The following error occurs when logging on to the system using SA today:
Login Failed for user 'sa '. Reason: the account is disabled. (. NET sqlclient data provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink? Prodname = Microsoft % 20sql % 20 server & evtsrc = MSSQLServer & evtid = 18470 & linkid = 20476
------------------------------
Server Name :.
Error number: 18470
Severity: 14
State: 1
Line number: 65536
You still cannot log on as usual because the SA account is unavailable. The modification is as follows:Change login from disable to enable