How to Fix the Error “A Network-related or Instance-specific Error occurred while Establishing a Connection to SQL Server”

Looking for the solution of network error while connecting to the SQL Server? It appears when you try to connect to the remote server using the IP address. Usually, the error appears in Windows 10. Well, You can fix this error by using various methods.

Method # 1: Collect Information about the Functioning of SQL Server

First, you need to check whether SQL Server is working or not. Often, the error occurs when SQL Server stops working. So, collect information about the functioning of SQL Server. Follow the steps below to do so.

Step 1: Check whether the SQL Server is installed and working

  • Press “Windows key + R” to launch the Run utility. Type “services.msc” here and press Enter.

services.msc in run dialogue box

  • In the services, check the status of “SQL Server services” to know whether it’s working or not. If the services aren’t running, right-click to it and select “Start.”

Step # 2: Get your System’s IP Address

You should obtain your system’s IP address by using the Command Prompt.

  • Press “Windows key + R” to open the Run utility. Type “cmd” here and press Enter.
  • In the Command Prompt, type “ipconfig” and press Enter.

IPv4 and IPv6 addresses in Command Prompt

  • It will show you the IPv6 and IPv4 addresses. Note down them.

Step 3: Obtain the TCP port number in SQL Server

  • Open “SQL Server Management Studio.”
  • Expand “Management” from the “Object Explorer.
  • Now, expand “SQL server log” and select the current log where you want to apply filter.
  • In the “Filter Setting” type “server is listening on” in the text box.
  • Select “OK” to save changes.
  • Now, you will see a message “server is listening on [‘any’ <ipv4> 1433]” on the screen. It means the SQL is actively listening to all the computers using that particular IP address and TCP.
  • If you don’t get this message, go to the “All Programs” and select “MS SQL server configuration tools.
  • Click the “SQL server configuration management” from here.
  • Right-click to “TCP\IP” and select “Enable” from here.
  • It will restart SQL server.

Method # 2: Enable Protocols for the Port 1433

Usually, every SQL Server doesn’t allow connection with the Database Engine from another computer. So, you need to enable the Protocols by using “Configuration Manager.” Follow the steps below in this context.

  • Go to the “Start” and select “All Programs” from here.
  • Select “SQL Server 2008 R2.”
  • Now, click “Configuration Tools” and select “SQL Server Configuration Manager.”
  • Click to expand “SQL Server Network Configuration.”
  • Select the option “protocols for MSSQL server.”
  • In the right panel, you will see “TCP\IP.” Select this option to move ahead.
  • Open the “protocols” tab and select “enable.”
  • Click the “IP Address” tab. Here, type “1433” for “TCP Port” in the IP All entry.
  • Now, restart the database engine and enjoy an error-free connection.

Method # 3: Create a Firewall Exception

Sometimes, Windows Firewall blocks the connection from other computers. Now, create a firewall exception to get rid of it. Follow the steps below to create a Firewall exception.

Press “Windows key + R” to open the Run utility. Type here “firewall.cpl” and press Enter.

Windows Firewall

Here, you will see the option “Advanced Settings” in the left pane. Select this option to move ahead.

Firewall advanced settings

  • In the Advanced Settings window, select “Inbound Rules” to view the current rules. In the right pane, you will see the option “New Rule.” Select this option to allow SQL Server connection.

Create New Rule in Firewall

  • Select “Port” in the Rule Type category and select Next to move ahead.
  • In the “Protocols and Ports” category, click the radio button “Specific Local Ports” and add “1433” to the text box.
  • Now, open the “Action” tab and click “Allow the connection.”
  • Select “Name” and type “SQL Server” or whatever you want to write for SQL.
  • From the Rule Type category, select “Custom.”
  • Now, you will be in “Program” category. Here, select the “Customize” tab.
  • It will open “Customize Service Settings.” Select the SQL Server and click “Apply to this service.”
  • Select “Finish” to end this process.
  • Now, try to connect again and this time, you will not get the error message.

  Method # 4: Check Local Connection

If your server’s name is in-accurate in the connection, it may trigger the error. For example, if your server name is “DESKTOP-WBLD880” and you have provided the server name like “DESKTOP-WBLD88”, it causes an error.

  • If you are using an Express edition of SQL, add “SQLEXPRESS” as a server name and save.
  • Now check connection. This time it will not show the error.

Leave a Comment