Configuration of the mixed Authentication Mode of sqlserver2005 and sa Login Problems
Question:
When 2005 is installed, the Hybrid Authentication mode is not set, and only window authentication is used. Now, you need to write the database connection string. If you use window authentication, It is troublesome to write, so I thought about how to change the SQL login mode from window to sqlserver login mode? After a while, I finally got the answer.
Answer:
1. log in with the window method, select the database instance, right-click and select Properties-security: Change the server authentication option from "window Authentication Mode" to "sqlserver and window Authentication mode ". Click OK to close the current object Resource Manager.
2. Log On again using window verification. In the tree structure on the left, select the "Security" option under "Database"-login name-Sa, right-click Properties -- enter the SA password to be set in "sqlserver authentication.
3. Restart the sqlserver service. Remember, it is to restart the service, not to disable sqlserver2005 and then enable it.
If you do not restart the sqlserver service and log in directly with SA, the following error is reported: "User 'sa 'Logon Failed. This user is not associated with a trusted SQL server connection ".
How to restart sqlserver service: go to window service, find "SQL Server (MSSQLServer)", and select restart. Alternatively, enter: net stop MSSQLServer at run time, And then: Net start MSSQLServer.
In this way, it is OK to log in with SA after the service is restarted.