A network-related or instance-specific error occurred while establishing a connection to SQL Server

In this article, we will be discussing about a popular error message, that is: “A network-related or instance-specific error occurred while establishing a connection to SQL Server

 

About the network-related or instance-specific error

Under certain circumstances, there are cases where you might try to connect to a SQL Server instance and get the error message: “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: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

 

A network-related or instance-specific error occurred while establishing a connection to SQL Server

 

This is the standard error message you get when your client does not “see” the SQL Server instance you are trying to connect to. However, there is more than one possible reasons for getting this message.

 

Possible Reasons for the network-related or instance-specific error

Here’s a list of possible reasons:

  • [Reason 1] You may have misspelled the instance name or IP 🙂
    • How to further investigate: 
      From the client, try to ping the network name for the SQL Server instance and see if you get a response.

      • If it is a default instance (i.e. SQLInstance1.contoso.local) then ping “SQLInstance1.contoso.local”
      • If it is a named instance  (i.e. VirtualName1.contoso.local\SQLInstance1) then ping “VirtualName1.contoso.local”
        > If ping does not reply, make sure that you are using the correct network name.
        > If you still cannot connect to SQL Server, proceed and check the rest of possible reasons.

 

  • [Reason 2] If the SQL Server instance is located on a different domain than your client, you may have not included the fully qualified domain name (FQDN) in the SQL Server instance name (i.e. SQLInstance1 vs SQLInstance1.contoso.local) – this assumes that the two domains are trusted between them
    • How to further investigate:
      Again, just like the actions in possible reason 1, try to ping the instance name from the client using the instance’s FQDN.
      > If you still cannot connect to SQL Server, proceed and check the rest of possible reasons.

 

  • [Reason 3] If there is a firewall in your network, you might not be allowed to access the SQL Server instance through the network.
    • How to further investigate:
      If you know for example that you want to connect to the SQL Server instance “SQLInstance1.contoso.local” on port 52500, then you can try from a command prompt on the client, to run the command: telnet SQLInstance1.contoso.local 52500
      If the above telnet command reports that “Could not open connection to the host, on port 52500: Connect failed” (or something similar), it means that there is no network communication between the client and the SQL Server instance at the designated port number. In this case, you should report it to your Network administrator.

 

  • [Reason 4] If you are trying to connect to a named instance, make sure that the SQL Server Browser service is running.
    • How to further investigate:
      Remotely connect on the SQL Server machine (or via remote administration) and check that the “SQL Server Browser” service is up and running.

 

  • [Reason 5] Make sure that your SQL Server instance allows remote connections.
    • How to further investigate:
      Connect remotely on the SQL Server machine, and log in to SQL Server Database Engine via SQL Server Management Studio. Then, right-click on the instance name, select “Properties” and check the “Connections” tab to see if the SQL Server instance allows remote connections. See the below screenshot for example.

      A network-related or instance-specific error occurred while establishing a connection to SQL Server

 

Hopefully if you go through the above, you will finally manage to successfully connect to your SQL Server instance.

 

Strengthen your SQL Server Administration Skills – Enroll to our Online Course!

Check our online course on Udemy titled “Essential SQL Server Administration Tips(special limited-time discount included in link).

Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!

Essential SQL Server Administration Tips - Online Course with Live Demonstrations and Hands-on Guides
(Lifetime Access/ Live Demos / Downloadable Resources and more!)

Learn More

 

Featured Online Courses:

 

Related Error Messages and ways to Resolve them:

 

Check out our latest software releases!

Subscribe to our newsletter and stay up to date!

Easily generate snippets with Snippets Generator!

Secure your databases using DBA Security Advisor!

Convert static T-SQL to dynamic and vice versa with Dynamic SQL Generator.

 

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)

Loading...

Reference: SQLNetHub.com (https://www.sqlnethub.com)

© 2018 SQLNetHub