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 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.