SQL Server- Unable to connect to SQL Express Error: 26-Error Locating Server/Instance Specified
Error Details: this error 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 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.
Other Errors related:
provider: named pipes provider, error: 40 – could not open a connection to sql server which is covered here.
If we are connecting from Windows PC/Client to Windows server/SQL Server (server with SQL Server installed) and are getting the error above then we need to check following:
On Windows SQL Server if we are trying to connect to Named instance then:
- Make sure the the Windows service called “SQL Server Browser” is started.
- 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.
- Make sure Windows Firewall is enabled incoming port TCP 1433
- Make Sure in SQL Server Configuration Manager that TCP/IP protocol is enabled and is set to to 1433(can be changed if needed)
- Make sure your server name is correct that is no typo on the name.
- Make sure your instance name is correct and there is actually such an instance on your target machine.
- 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).
Additionally, Make sure
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 machinename\instancename or in your connection string is right format with right instance name.