SQL Server How to solve the problem of being unable to connect ? Tips " Can't connect to the server , user xxx Login failed " For what reason ?
The cause of the error is due to SQL Server Used " only Windows" Authentication method for , So users can't use SQL Server Login account for ( Such as sa ) Connect . The solution is as follows :
SQL Server Can't connect to the server 1
1. Using enterprise governance on the server side , And choose " Use Windows Authentication " Connected to the SQL Server.
2. an "SQL Server Group ", Right click SQL Server Name of the server , choice " attribute ", Re selection " Security " tab .
3. stay " Authentication " Next , choice "SQL Server and Windows ".
4. Restart SQL Server service .
SQL Server Can't connect to the server 2
In the above solutions , If it's in the first 1 Use " Use Windows Authentication " Connect SQL Server Failure , Then solve this problem by modifying the registry :
1. Click on " Start "-" function ", Input regedit, Enter to enter the registry editor .
2. Expand the registry keys in turn , Browse to List key :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer]
3. Find the name on the right side of the screen "LoginMode", Double click to edit double byte values .
4. Change the original value from 1 Change it to 2, Click on " determine ".
5. Close the registry editor .
6. Restart SQL Server service .
here , Users can successfully use sa Create a new SQL Server register , But it still doesn't work Windows Authentication mode to connect SQL Server.
This is because in the SQL Server There are two default login accounts in BUILTIN\Administrators\Administrator Be deleted .
SQL Server Can't connect to the server 3
To restore these two accounts , You can use the following methods :
1. Open the corporate governance , Expand the server group , Then expand the server .
2. an " Security ", Right click " Sign in ", And then click " New login ".
3. stay " name " In the box , Input BUILTIN\Administrators.
4. stay " Server role " Tab , choice "System Administrators".
5. Click on " determine " sign out .
6. Use the same method to add \Administrator Sign in .