The solutions to the four most common errors in SQL Server connection are as follows:
1. "SQL Server does not exist or access is denied"
This is the most complex. There are many causes of errors and there are many aspects to check.
Generally, there are several possibilities:
1. incorrect spelling of the SQL Server name or IP address
2. The server network configuration is incorrect.
3. The client network configuration is incorrect.
To solve this problem, we generally need to follow the steps below to find out the cause of the error step by step.
============== First, check the network physical connection ================
Ping <Server IP Address/Server Name>
If the ping <Server IP address> fails, the physical connection is faulty. In this case, Check hardware devices, such as NICs, hubs, and routers.
Another possibility is that a firewall software is installed between the client and the Server. For example, the ISA Server. firewall software may block the ping and telnet responses.
Therefore, when checking for connection problems, we must temporarily disable the firewall software or open all closed ports.
If the ping <Server IP address> succeeds, the ping <Server Name> fails.
It indicates that there is a problem with name resolution. At this time, check whether the DNS service is normal.
Sometimes the client and server are not in the same LAN. At this time, the server name may not be used to identify the server. At this time, we can use the HOSTS file for name resolution,
The specific method is:
1. Use notepad to open the HOSTS file (usually in C: \ WINNT \ system32 \ drivers \ etc ).
Add a record corresponding to the IP address and server name, for example:
172.1610.24 myserver
2. You can also configure it in the SQL Server Client Network utility, which will be described in detail later.
============ Second, use the telnet command to check the running status of the SQL Server ==============
Telnet <Server IP addresses> 1433
If the command is successfully executed, you can see that the cursor keeps flashing in the upper left corner after the screen flashes. This indicates that the SQL Server is working normally and is listening for TCP/IP connection at port 1433.
If the command returns an error message "unable to open the connection", it indicates that the Server has not started the SQL Server service,
The TCP/IP protocol may not be enabled on the Server, or the Server does not listen on the default port 1433 of SQL Server.