Home » SQL Server- Unable to connect to SQL Server Error 26

SQL Server- Unable to connect to SQL Server Error 26

Error Description:

SQL server error 26- Unable to connect to SQL Express Error: 26-Error Locating Server/Instance Specified

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)

Error Details: this sql server error 26 error locating server instance message is often encountered when connection to a SQL Server is tried and don’t know where to start to solve the problem.

We get this sql server error 26 error message only when we are trying to connect to a SQL Server named instance.

Every time we try to make a connection to SQL Server named instance, we will send a SSRP UDP packet to the server machine UDP port 1434. We need this step to know configuration information of the SQL instance, e.g., protocols enabled, TCP port, pipe name etc. Without these information, client does know how to connect the server and it fails with this specified error message sql server error 26 error locating server instance.

Other Errors related:

provider: named pipes provider, error: 40 – could not open a connection to sql server which is covered here.

Solution:

7 ways for resolving the sql server error 26 which is for connecting from Windows PC/Client to Windows server/SQL Server (server with SQL Server installed) and are getting the sql error 26 above then we need to check following:

On Windows SQL Server if we are trying to connect to Named instance then 1-2 steps are related. If default instance then all other steps for resolving sql server error 26 error locating server instance

  1. Make sure the the Windows service called “SQL Server Browser” is started.
  2. Make sure Windows Firewall is enabled for incoming port UDP 1434 that is we need to put sqlbrowser.exe and/or UDP port 1434 into exception.
  3. Make sure Windows Firewall is enabled incoming port TCP 1433. Below are steps in general for exceptions in firewall.
    1.  You must build an incoming rule that accepts traffic for SQL Server or from all IP addresses defined for the failover cluster instance, as well as any possible distant server IP addresses. To do so, simply follow the steps below.
      1. From the Control Panel, go to Adminstrative Tools.
      2. Select Windows Firewall with Advanced Security from the Administrative Tools menu.
      3. Click Inbound Rule in the Windows Firewall with Advanced Security on Local Computer column, then New Rule in the right pane.
      4. Advanced Security for Windows Firewall
      5. Select Custom from the New Inbound Rule Wizard box, then click the Next button.
      6. Choose Custom.
      7. Is this regulation applicable to all programmes or just one in particular? After selecting All Programs, click the Next button. All Programs should be selected
      8. Select Any from the list of protocol types, then click the Next button.
      9. Choose a protocol type
      10. Which remote IP addresses are affected by this rule? After selecting these IP addresses, click the Add button.
      11. These IP Addresses Should Be Considered. Type the IP address under This IP address or subnet in the IP Address dialogue box, then click the Ok button.
      12. When a connection meets the required criteria, what action should be taken? Allow the connection to be established, then click the Next button.
      13. Allow the connection to happen. Select Next from the drop-down menu.
  4. Make Sure in SQL Server Configuration Manager that TCP/IP protocol is enabled and is set to to 1433(can be changed if needed)
  5. Make sure your server name is correct that is no typo on the name.
  6. Make sure your instance name is correct and there is actually such an instance on your target machine.
  7. Make sure the server machine is reachable that is DNS can be resolved correctly and we are able to ping the server (not always true as ping is disabled sometimes for security).

Additional Solutions for SQL server error 26

Make sure your database engine is configured to accept remote connection. Right click on instance to go to properties page and make sure its enabled to accept remote connections.

If we are connecting to a named SQL Server instance, make sure that instance name in your connection string is right. Usually the format needed to specify the database server is Servername\instancename or in your connection string is right format with right instance name.

Leave a Reply

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