A network-related or instance-specific error occured SQL server 2019

If you have just installed Microsoft SQL server 2019 and are having issues connecting to it from other machines, read here for a possible solution.

If you see the following error, read on:

Screenshot of error
Cannot connect to server.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

The network path was not found

1. Problem

Usually, when installing SQL server, not everything is configured for remote access out-of-the-box. This means you need to make a few changes to the default configuration to make it work.

2. Make sure TCP/IP is enabled on port 1433

The first step is to make sure the TCP/IP option for SQL server is enabled on port 1433. To do this, follow these steps:

  1. First open “SQL server 2019 Configuration Manager”.
  1. Then, in the left tree view:
    1. Select “SQL Server Network Configuration” –> “Protocols for [instance]”
    2. In the right view right mouse click on “TCP/IP”.
      • (PS: also make sure the TCP/IP record shows “Enabled”, if it doesn’t, enable it now)
    3. In the context menu, click on “properties”.
  1. In the next screen, do the following:
    1. Click on the tab “IP Addresses”
    2. Make sure that for every IP address the fields “Active” and “Enabled” are set to “Yes”.
    3. Lastly, make sure that for the entry “IPAll” the “TCP Port” value is set to “1433”.
    4. Now click on “OK” and then restart the SQL server processes via services.msc.

2. (Optional) allow port 1433 in Windows Firewall

If after step #1 you still cannot connect to the SQL server, make sure that the Windows Firewall on the SQL server machine is configured to allow incoming traffic on port 1433. If you are not sure whether you have done this already, follow these additional steps.

First, open up a Command Prompt (CMD) window as administrator.

Then, type the following command:

netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT 

You should see the following message which contains “Ok”:

3. Test SQL connection again

If you followed these steps, the SQL connection should now work succesfully!

If you are still having trouble however, make sure that all SQL services are running (via services.msc) and that there are no additional firewalls intervening. I hope this article has helped!

By Leendert de Borst

Freelance software architect with 10+ years of experience. Expert in translating complex technical problems into creative & simple solutions.

Leave a comment

Your email address will not be published. Required fields are marked *