0% found this document useful (0 votes)
105 views

A Network-Related or Instance-Specific Error Occurred While Establishing A Connection To SQL Server

The document discusses troubleshooting methods for resolving the error "A Network-related or Instance-specific Error occurred while Establishing a Connection to SQL Server". It provides steps to check if the SQL Server instance is installed and running, obtain the server's IP address and TCP port number, and enable protocols like TCP/IP on port 1433 to allow remote connections to the SQL Server instance. Enabling the correct protocols and ports and ensuring the instance is accessible on the network address are key to fixing this connection error.

Uploaded by

almannan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

A Network-Related or Instance-Specific Error Occurred While Establishing A Connection To SQL Server

The document discusses troubleshooting methods for resolving the error "A Network-related or Instance-specific Error occurred while Establishing a Connection to SQL Server". It provides steps to check if the SQL Server instance is installed and running, obtain the server's IP address and TCP port number, and enable protocols like TCP/IP on port 1433 to allow remote connections to the SQL Server instance. Enabling the correct protocols and ports and ensuring the instance is accessible on the network address are key to fixing this connection error.

Uploaded by

almannan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

How to Fix the Error ‘A Network-related or Instance-


specific Error occurred while Establishing a
Connection to SQL Server’ ?
By Sadia Majeed • November 10, 2020 5 minutes read

“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)”.

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


Server.

The article discusses a thorough list of troubleshooting methods that can be


used to connect to the SQL server. First of all, we will discuss problems that
arise when you need to connect to the remote server using IP address as this
is the most common cause. These steps are written in “SQL Server 2008 R2″
on “Windows 10″, but they can be used on other versions too with minor
amendments.

The error usually means that the “SQL server is not found” or “TCP port is
either unknown or wrong”, or it can be blocked by the “firewall”.

Method 1: Gather information about the instance

1 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

of the SQL Server.


In this section, we will discuss ways to check either the instance of the SQL
Server is working or not, along with methods to fix it if it is not working.

Step 1. Check if an instance of SQL Server is


installed and is working or not
First of all login to the computer hosting the SQL server instance.  Now, follow
these steps to open Services in Windows.

1. Click on the “Start menu” and then point to “All programs”.

2. Now point to the SQL Server, and then point to “Configuration tools”

3. Click “SQL Server Configuration Manager”.

4. Now select “SQL Server services” and check in the right pane whether
the instance of a database engine is running or not.

5. Moreover, this can be opened directly by typing “services.msc” in the


RUN and click OK. The following screen appears.

Opening services by typing “services.msc” in the RUN box.

Now, check if the database engine has been configured to accept remote
connections. To check this, follow the following steps.

2 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

1.  After services have been opened you can see database engine in the
right pane. The “MSSQLSERVER” is a default unnamed instance. A
default instance can only be one.

2. In the case of the “SQL Express”, default instance will be “SQLEXPRESS”


unless it is renamed by someone during installation.

3. Check if the instance you are trying to connect has the same name as
given in the services.

4. Also, confirm if the status of the instance is “RUNNING”.

5. Moreover, if you are trying to connect to named instant, then double-


check if “SQL Server Browser service” is already running. Thus you need
to check if the “SQL Server Browser service” is started on the server on
which SQL Server is installed.

6. In case, the database engine is not running then you need to restart it. So
to start the “Database Engine”, in the right pane, right-click on the
“Database Engine” (“MSSQLSERVER” default one), and then click
“Start”.

Check if the “SQL Server Browser service” is already running.

Step 2. Obtain the IP address of the computer.


To do this follow these steps.

3 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

1. First of all, from the start menu, click “RUN” and type “cmd” and press
ok.

2. In command prompt window type “ipconfig” and note down IPV4 and
IPV6 addresses. People mostly use IPV4 address.

Get IPv4 address

Step 3. Get the TCP port number used by the SQL


server
Follow the following steps to get TCP port number used by the SQL server

4 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

1. Using “SQL Server Management Studio” (SSMS) connect to the instance


of SQL server

2. From “object explorer” expand “Management”, expand “SQL server


log” and click on the current log on which you have to apply filter.

3. To apply filer click apply filter and type ” server is listening on” in
Message contains text box. Click apply filter and press ok.

Applying filter ” server is listening on”

4. A message like “server is listening on [‘any’ <ipv4> 1433]” should be


shown. The message shows that the SQL Server instance is listening on
all computers with IP address IPv4 and TCP port is 1433 (default).

5 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

5. For more than one instance TCP port will be different for each instance.

Message showing server is listening on IPv4 and port 1433

6. If it is not a case then click “All programs”, point to MS SQL server


configuration tools, “SQL server configuration management” , and
right-click “TCP\IP” and click enable and restart SQL server to let
changes create impact.

Method 2: Enabling protocols for port 1433


Connecting to the “Database Engine” from another computer is not allowed
in many “SQL Server” implementations unless an administrator utilizes
“Configuration Manager” to allow it. The following steps should be followed
to do this.

6 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

1. Click on “Start menu” and then point to “All programs”

2. Point towards the “SQL Server 2008 R2”

3. Point towards “Configuration tools”, and after this click “SQL Server
Configuration Manager”.

4. Expand “SQL Server Network Configuration”.

5. Select “protocols for MSSQL server”. Click on “TCP\IP” in the right


panel.

Opening “Protocol Tab”

6. In the tab “protocol” set enable as “yes”.

7 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

7. Choose the “IP Address tab” from the window and set “TCP Port” equal
to “1433″ in the “IP All” entry.

Set port no in “IP Address tab”

8. Now restart database engine to make changes leave their impact. To do


this from the left pane, select SQL server services and then from right
pane right-click database engine instance and press “restart”.

Method 3: Create a Firewall exception


Sometimes Windows firewall turns on and blocks links from another
computer. To fix it follow these steps.

8 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

9 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

1. Click “Start” and start typing “Firewall.cpl” in the run box.

Opening “Firewall.cpl”

2. You get the “configuration frame” for Windows Firewall by running the
“firewall.cpl” command. You may turn the firewall “on/off” with
exceptions and other settings applied here. Check the firewall status and
turn it on to activate it if the firewall is off. If you’ve just turned this on,
your firewall will block any “SQL Server” connection request to your
computer at this point. Through making certain exceptions, you’d need
to configure the firewall to allow access to a SQL Server database engine.

10 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

3. Click on “Advanced Settings”

Click on advanced settings option to


open firewall rules

4. We need to learn about the ports used for “SQL Server” and the “SQL
Server Browser” feature when dealing with “SQL Server” firewall
configurations. Both are involved in setting up a “firewall” for the “SQL
Server” . It would, therefore, be necessary to go separately through both
concepts.

11 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

5. You may permit or block traffic attempts that meet the requirements in t
he rule to access the computer. By default 
“inbound traffic” is blocked, you need to establish “inbound rule” to allo
w traffic to reach the computer.
Tap the Inbound Rules from the left pane of the “Windows Firewall with 
Advanced Security” and click the New Rule from the “Actions” window. 

Selecting New Rule from the “Actions” window.

12 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

6. Select “Port” under “Rule Type” and press “Next” button

Selecting “port” option

7. Now select “Specific local ports” and set it to 1433

set “specific local port” to 1433

13 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

8. Now select
“Allow the connection” in the “Action” dialog and press the Next button

selecting “Allow the connection”

9. Give the rule a “title” on this stage and press the “Finish” button.

Give a title to the rule

14 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

10. Select “Custom rule” from “New rule” tab

Select “Custom rule” from “New rule” tab

11. Click “customize”

Click “customize”

15 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

12. Select
“Database Engine Instance Service” from the “Customize Service Settin
gs” under “Apply to this service” and click the “OK” button

Select “Database Engine Instance Service” from the “Customize Service Settings” under
“Apply to this service” and click the “OK” button

16 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

13. Give the rule a name and click finish

Give a title to the new rule

14. Also add “sqlservr.exe” typically located in “C:\Program Files


(x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Bin” (or check your
actual folder path) to the path, check your installs for the actual folder
path) and port whose default value is “1433”. Also, check your
connection string.

Method 4: Check Local connection


One of the reasons for this error is if we provide the wrong server name, this
will result in an error. As seen in the figure below provided server name is
“DESKTOP-UD88TLT1” whereas accurate server name is “DESKTOP-UD88TLT”.
So it will be unable to connect to the server which will result in an error
“cannot connect to server”. This is the most basic reason for error, so we
should check it first if working locally.

17 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

The error arises while locally connecting to SQL server with the wrong server
name In case you are using express edition following your server name, add
“\SQLEXPRESS” as seen in the figure below.

Locally connecting to SQL server while using express edition

18 of 19 16-01-2021, 15:04
How to Fix the Error 'A Network-related or Instance-specific Error occur... https://appuals.com/how-to-fix-the-error-a-network-related-or-instance-s...

Read Next

How to Fix Error 0x8007003B "An unexpected network error occurred"

Fix: Remote Desktop Connection 'Internal Error has Occurred'

Fix: Oops… a server error occurred and your email was not sent (#707)

Fix: oops... a server error occurred and your email was not sent. (#007)

1 Comment appuals.com Privacy Policy 1 Login

Recommend 3 Tweet Share Sort by Best

Join the discussion…

LOG IN WITH OR SIGN UP WITH DISQUS ?

dd • 12 days ago
Super helpful
• Reply • Share ›

Subscribe Add Disqus to your siteAdd DisqusAdd


Do Not Sell My Data

19 of 19 16-01-2021, 15:04

You might also like