Skip to content

Commit 9aaf5d7

Browse files
committed
initial updates
1 parent 815e17d commit 9aaf5d7

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

support/sql/database-engine/connect/network-related-or-instance-specific-error-occurred-while-establishing-connection.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: A network-related or instance-specific error occurred
3-
description: Provides troubleshooting steps for network-related or instance-specific errors if you can't connect to an instance of the SQL Server Database Engine on a single server.
2+
title: Fix network-related or instance-specific errors in SQL Server
3+
description: Troubleshoot and resolve network-related or instance-specific errors when connecting to SQL Server. Follow step-by-step guidance to fix common configuration issues.
44
ms.date: 01/10/2025
55
ms.custom: sap:Database Connectivity and Authentication
66
author: aartig13
@@ -11,11 +11,13 @@ ms.reviewer: jopilov
1111

1212
_Applies to:_   SQL Server
1313

14-
When connecting to a SQL Server instance, you may encounter one or more [error messages](#common-sql-server-connection-error-messages). This article explains how to [collect the necessary information](#gather-information-to-troubleshoot-sql-server-connection-errors) to diagnose these issues and outlines a structured troubleshooting approach to help you resolve these issues, starting with basic checks and moving on to more advanced techniques.
14+
## Summary
15+
16+
This article helps you troubleshoot network-related or instance-specific errors that occur when you connect to a SQL Server instance. These errors typically appear when the SQL Server instance isn't running, the server or instance name is incorrect, network protocols aren't configured correctly, or firewalls block required ports. This guide explains how to gather diagnostic information and outlines a structured troubleshooting approach, starting with basic checks and moving on to more advanced techniques.
1517

1618
## Common SQL Server connection error messages
1719

18-
The complete error messages vary depending on the client library that's used in the application and the server environment. You can check the following details to see if you're encountering one of the following error messages:
20+
The complete error messages vary depending on the client library that's used in the application and the server environment. Expand each message below to see if you're encountering one of the following error messages:
1921

2022
### "A network-related or instance-specific error occurred while establishing a connection to SQL Server. Verify that the instance name is correct and that SQL Server is configured to allow remote connections"
2123

@@ -101,11 +103,11 @@ This message means that SQL Server isn't listening on the Shared Memory or Named
101103

102104
We recommend that you gather the information listed in this section using one of the following options before proceeding with the actual steps to troubleshoot the error.
103105

104-
### Option 1: Use the SQL Check tool to gather the required information
106+
### Use the SQL Check tool to gather the required information
105107

106108
If you can sign in locally to the SQL Server computer and have administrator access, use [SQLCHECK](https://github.com/microsoft/CSS_SQL_Networking_Tools/wiki/SQLCHECK). This tool provides most of the information required for troubleshooting in one file. Review the tool's home page for more information on using the tool and the information it gathers. You can also check the recommended [prerequisites](../connect/resolve-connectivity-errors-checklist.md) and checklist page.
107109

108-
### Option 2: Collect the data individually using the following procedures
110+
### Collect the data individually using the following procedures
109111

110112
#### Get the instance name from Configuration Manager
111113

@@ -148,13 +150,15 @@ In most cases, you connect to the Database Engine on another computer by using t
148150
149151
## Step 1:Verify that the instance is running
150152

151-
### Option 1: Use the SQLCHECK output file
153+
Use one of the following methods to verify that the instance is running.
154+
155+
### Use the SQLCHECK output file
152156

153157
1. Search the SQLCHECK output file for "SQL Server Information".
154158
1. In the section titled "Services of Interest", find your SQL Server instance under **Name** and **Instance** (for named instances) columns and check its status by using **Started** column. If the value is **True**, the services are started. Otherwise the service is currently not running.
155159
1. If the service isn't running, [start the service](/sql/database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services) by using either SQL Server management studio, SQL Server Configuration manager, [PowerShell](/powershell/module/sqlserver/start-sqlinstance), or Services applet.
156160

157-
### Option 2: Use SQL Server Configuration Manager
161+
### Use SQL Server Configuration Manager
158162

159163
To verify that the instance is running, select **SQL Server Services** in **SQL Server Configuration Manager** and check the symbol by the SQL Server instance.
160164

@@ -163,7 +167,7 @@ To verify that the instance is running, select **SQL Server Services** in **SQL
163167

164168
If the instance is stopped, right-click the instance and select **Start**. Then, the server instance starts, and the indicator becomes a green arrow.
165169

166-
### Option 3: Use PowerShell commands
170+
### Use PowerShell commands
167171

168172
You can use the following command in PowerShell to check the status of SQL Server services on the system:
169173

@@ -179,15 +183,16 @@ Get-ChildItem -Path "c:\program files\microsoft sql server\mssql*" -Recurse -Inc
179183

180184
## Step 2: Verify that the SQL Server Browser service is running
181185

186+
Use one of the following methods to verify that the SQL Server browser service is runnning.
182187
> [!NOTE]
183188
> This step is required only for troubleshooting connectivity issues with named instances.
184189
185-
### Option 1: Use the SQLCHECK output file
190+
### Use the SQLCHECK output file
186191

187192
1. Search the SQLCHECK output file for "SQL Server Information".
188193
1. In the section titled "Services of Interest", search for SQLBrowser in the **Name** column and check its status using the **Started** column. If the value is True, the service is started. Otherwise, the service is currently not running, and you need to start it. For more information, see [Start, stop, pause, resume, restart SQL Server services](/sql/database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services).
189194

190-
### Option 2: Use SQL Server Configuration Manager
195+
### Use SQL Server Configuration Manager
191196

192197
To connect to a named instance, the SQL Server Browser service must be running. In **SQL Server Configuration Manager**, locate the **SQL Server Browser** service and verify that it's running. If it's not running, start the service. The SQL Server Browser service isn't required for default instances.
193198

@@ -215,7 +220,7 @@ Aliases are often used in client environments when you connect to SQL Server wit
215220
> [!NOTE]
216221
> The following options only apply to the applications that use [SQL Server Native Client](/sql/relational-databases/native-client/SQL-server-native-client) to connect to SQL Server.
217222
218-
### Option 1: Use the SQLCHECK output file
223+
### Use the SQLCHECK output file
219224

220225
1. In the SQLCHECK output file, search for the string SQL Aliases. (This string will be inside the **Client Security and Driver Information** section of the file)
221226
1. Review the entries in the table. If there's none present, there are no aliases on the computer. If there's an entry, review the information to ensure the server name and port number are set to the correct values.
@@ -233,7 +238,7 @@ prodsql TCP prod_sqlserver 1430
233238

234239
The output indicates that `prodsql` is an alias for a SQL Server called `prod_sqlserver` that's running on port 1430.
235240

236-
### Option 2: Check aliases in SQL Server Configuration Manager
241+
### Check aliases in SQL Server Configuration Manager
237242

238243
1. In [SQL Server Configuration Manager](/sql/relational-databases/sql-server-configuration-manager), expand **SQL Server Native Client Configuration**, and select **Aliases**.
239244
1. Check whether any aliases are defined for the server that you're trying to connect to.
@@ -249,10 +254,10 @@ The output indicates that `prodsql` is an alias for a SQL Server called `prod_sq
249254
- When connecting to a default instance named *Mydefaultinstance*, the pipe name should be *\\\\Mydefaultinstance\pipe\sql\query*.
250255
- When connecting to a named instance *MySQL\Named*, the pipe name should be *\\\\MySQL\pipe\MSSQL$Named\sql\query*.
251256

252-
### Option 3: Check aliases in SQL Server Client Network Utility
257+
### Check aliases in SQL Server Client Network Utility
253258

254259
1. Open [SQL Server Client Network Utility](/previous-versions/windows/desktop/odbc/dn170535(v%3dvs.85)) by typing *cliconfg.exe* in your Run command.
255-
1. Follow step 2 in [Option 2: Check aliases in SQL Server Configuration Manager](#option-2-check-aliases-in-sql-server-configuration-manager).
260+
1. Follow step 2 in [Check aliases in SQL Server Configuration Manager](#check-aliases-in-sql-server-configuration-manager).
256261

257262
## Step 5: Verify the firewall configuration
258263

@@ -294,9 +299,9 @@ If your SQL instance is a named instance, it may be configured to use either dyn
294299

295300
## Step 6: Verify the enabled protocols on SQL Server
296301

297-
In some installations of SQL Server, connections to the Database Engine from another computer aren't enabled unless an administrator manually enables them. You can use one of the following options to check and enable the necessary protocols to allow remote connections to SQL Server Database Engine.
302+
In some installations of SQL Server, connections to the Database Engine from another computer aren't enabled unless an administrator manually enables them. Use one of the following options to check and enable the necessary protocols to allow remote connections to SQL Server Database Engine.
298303

299-
### Option 1: Use the SQLCHECK output file
304+
### Use the SQLCHECK output file
300305

301306
1. Search the SQLCHECK output file for "Details for SQL Server instance" section and locate the information section for your SQL Server instance.
302307
1. In the section, find the values listed in the following table to determine if the SQL Server protocols are enabled:
@@ -312,7 +317,7 @@ In some installations of SQL Server, connections to the Database Engine from ano
312317
> [!NOTE]
313318
> After enabling a protocol, the Database Engine must be stopped and restarted for the change to take effect.
314319
315-
### Option 2: Use SQL Server Configuration Manager
320+
### Use SQL Server Configuration Manager
316321

317322
To enable connections from another computer by using the SQL Server Configuration Manager, follow these steps:
318323

@@ -359,7 +364,7 @@ If you can't install Management Studio, you can test the connection by using the
359364

360365
> [!NOTE]
361366
> You can't troubleshoot the problem without enough information because some error messages are passed to the client intentionally. This is a security feature to avoid providing an attacker with information about SQL Server. To view the details about the error, see the SQL Server error log.
362-
1. If you receive **error 18456 Login failed for user**, Books Online article [MSSQLSERVER_18456](/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error) contains additional information about error codes. Aaron Bertrand's blog also has an extensive list of error codes at [Troubleshooting Error 18456](https://sqlblog.org/2020/07/28/troubleshooting-error-18456) (external link). You can view the error log by using SSMS (if you can connect), in the **Management** section of the **Object Explorer**. Otherwise, you can view the error log with the Windows Notepad program. The default location varies with your version and can be changed during setup. The default location for SQL Server 2019 (15.x) is *C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\ERRORLOG*.
367+
1. If you receive **error 18456 Login failed for user**, the article [MSSQLSERVER_18456](/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error) contains additional information about error codes. Aaron Bertrand's blog also has an extensive list of error codes at [Troubleshooting Error 18456](https://sqlblog.org/2020/07/28/troubleshooting-error-18456) (external link). You can view the error log by using SSMS (if you can connect), in the **Management** section of the **Object Explorer**. Otherwise, you can view the error log with the Windows Notepad program. The default location varies with your version and can be changed during setup. The default location for SQL Server 2019 (15.x) is *C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\ERRORLOG*.
363368
1. If you can connect by using shared memory, test connecting by using TCP. You can force a TCP connection by specifying `tcp:` before the name. Here are the examples:
364369

365370
|Connecting to:|Type:|Example:|

0 commit comments

Comments
 (0)