I. "SQL Server does not exist or access" This is the most complicated, the reason for the error occurs, and it is more than the need to check. Generally, there are several possibilities: 1, SQL Server name or IP address spelling incorrectly 2, server-side network configuration is incorrect 3, client network configuration is wrong to solve this problem, we generally have to follow the following steps to find out the cause of the error. ======= ====== First, check the network physical connection ============= ping
If ping
Unsuccessful, there is a problem with physical connection, this time you have to check hardware devices, such as NIC, HUB, router, etc. There is also a possibility that the client and server are installed, such as ISA Server. Firewall software Will shield the response to ping, telnet, etc. Therefore, when checking the connection problem, we must first turn the firewall software to close, or open all closed ports. If ping
Successful, ping
Failure indicates that the name parsing has a problem. At this time, it is time to check if the DNS service is normal. Sometimes the client and server are not in the same local area network, this time it is likely to use the server name directly to identify the server, then we can use the Hosts file. To make a name resolution, the specific method is: 1. Use Notepad to open the HOSTS file (in general in C: / Winnt / System32 / Drivers / etc). Add a corresponding record of the IP address and the server name, such as: 172.168. 10.24 myserver 2. Configure it in the client network utility of SQL Server, which will be detailed. ============= Secondly, use the Telnet command to check the SQL Server server operating status == =========== Telnet
1433 If the command is executed, it can be seen that the cursor is on the upper left corner after flashing, which means that the SQL Server server works fine and is listening to the TCP / IP connection of the 1433 port. If the command returns "Unable to open the connection" error Information, the server side does not start the SQL Server service, or the server side may not enable the TCP / IP protocol, or the server side does not listen on the default port 1433 in SQL Server. ============= Next, we have to check the server-side network configuration on the server and check if the named pipe is enabled. Do you have a TCP / IP protocol, etc. ============= can take advantage of SQL Server Network use tools to check. Click: Programs - Microsoft SQL Server - Server Network Using Tools Open the tool, you can see which protocols have been enabled in "General". In general, we enable named pipes and TCP / IP protocol. Point TCP / IP protocol, select "Properties", we can check the settings of the SQK Server service default port General, we use SQL Server default 1433 port. If the "hidden server" is selected, it means The client cannot see this server by enumerating the server, but does not affect the connection. ============= Next We want to check the client's network configuration ============= We can also use the client network using the SQL Server to check, the difference is that this time is the client to run this tool. Click: Program - - Microsoft SQL Server - Client Network Using Tools Open the tool, in the General item, you can see which protocols have been enabled. In general, we also need to enable naming pipes and TCP / IP protocols. Click TCP / IP protocol, select "Properties", you can check the settings of the client default connection port, which must be the server. Click the Alias tab, you can also configure an alias for the server. The alias of the server is used to connect Name, the server in the connection parameter is the real server name, both can be the same or different. The settings of the alias are similar to the use of the HOSTS file. By the above aspects, the first error can basically exclude. -------------------------------------------------- ---------------------------- II. "Unable to connect To the server, the user XXX login failed "The reason for this error is because SQL Server uses" only Windows "authentication mode, so users cannot connect to SQL Server's login accounts (such as SA). Solution As shown below: 1. Use the Enterprise Manager on the server side, and select "Use Windows Authentication" to connect SQL Server 2. Expand "SQL Server Group", right-click the name of the SQL Server server, select "Properties", select "security "Tab 3. Under" Authentication ", select SQL Server and Windows. 4. Restart SQL Server Services. In the above solution, if you use" using Windows Authentication "to connect SQL Server in step 1 Failure, then resolve this issue by modifying the registry: 1. Click "Start" - "Run"
Enter the regedit, enter the registry editor 2. Expand the registry key in turn, browse to the following registry key: [HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / MSSQLServer / MSSQLServer] 3. Find name "Loginmode" on the right side, double click Edit the double-byte value 4. Change the original value from 1 to 2, click "OK" 5. Turn off the Registry Editor 6. Restart SQL Server Services. At this point, users can successfully use SA in Enterprise Manager SQL Server is registered, but it is still unable to connect SQL Server using Windows authentication mode. This is because there are two default login accounts in SQL Server: Builtin / Administrators
/ Administrator is deleted. To restore these two accounts, you can use the following methods: 1. Open Enterprise Manager, expand the server group, then expand the server 2. Expand "Security", right-click "Login", then click " New login "3. In the Name box, enter Builtin / Administrators 4. In the Server Role tab, select" System Administrators "5. Click" OK "to exit 6. Add the same method Add