Skip to content

Commit 2b65944

Browse files
committed
Adjust headings
1 parent 6e25524 commit 2b65944

1 file changed

Lines changed: 28 additions & 32 deletions

File tree

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

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,17 @@ The complete message is:
9797
9898
This message means that SQL Server isn't listening on the Shared Memory or Named Pipes protocol.
9999

100-
## Solution
101-
102-
To resolve network-related or instance-specific connection errors, work through the following troubleshooting steps.
103-
104-
### Gather information to troubleshoot SQL Server connection errors
100+
## Gather information to troubleshoot SQL Server connection errors
105101

106102
Before you start troubleshooting, gather the information listed in this section. You can use one of the following options to collect this information.
107103

108-
#### Use the SQL Check tool to gather the required information
104+
### Use the SQL Check tool to gather the required information
109105

110106
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 about using the tool and the information it gathers. You can also check the recommended [prerequisites and checklist](../connect/resolve-connectivity-errors-checklist.md) page.
111107

112-
#### Collect the data individually using the following procedures
108+
### Collect the data individually using the following procedures
113109

114-
##### Get the instance name from Configuration Manager
110+
#### Get the instance name from Configuration Manager
115111

116112
On the server that hosts the SQL Server instance, use [SQL Server Configuration Manager](/sql/relational-databases/sql-server-configuration-manager) to verify the instance name:
117113

@@ -126,7 +122,7 @@ On the server that hosts the SQL Server instance, use [SQL Server Configuration
126122
- **SQL SERVER (MSSQLSERVER)** indicates a default instance of SQL Server. The name of the default instance is \<computer name>.
127123
- **SQL SERVER (\<instance name>)** indicates a named instance of SQL Server. The name of the named instance is \<computer name>\\\<instance name>.
128124

129-
##### Get the IP address of the server
125+
#### Get the IP address of the server
130126

131127
Use the following steps to get the IP address of the computer hosting the instance of SQL Server.
132128

@@ -136,7 +132,7 @@ Use the following steps to get the IP address of the computer hosting the instan
136132
> [!NOTE]
137133
> SQL Server can connect by using either IP version 4 protocol or IP version 6 protocol. Your network could allow either or both.
138134
139-
##### Get the TCP port of the instance
135+
#### Get the TCP port of the instance
140136

141137
In most cases, you connect to the Database Engine on another computer by using the TCP protocol. To get the TCP port of the instance, follow these steps:
142138

@@ -150,17 +146,17 @@ In most cases, you connect to the Database Engine on another computer by using t
150146
> - IP address 127.0.0.1 is probably listed. It's called the loopback adapter address. Only processes on the same computer can use the IP address to connect.
151147
> - You can also view the SQL Server error log by using a text editor. By default, the error log is located at _Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG_ and _ERRORLOG.n_ files. For more information, see [Viewing the SQL Server error log](/sql/tools/configuration-manager/viewing-the-sql-server-error-log).
152148
153-
### Verify that the instance is running
149+
## Verify that the instance is running
154150

155151
Use one of the following methods to verify that the instance is running.
156152

157-
#### Use the SQLCHECK output file
153+
### Use the SQLCHECK output file
158154

159155
1. Search the SQLCHECK output file for "SQL Server Information".
160156
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 the **Started** column. If the value is **True**, the services are started. Otherwise, the service isn't currently running.
161157
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 [SQL Server Management Studio](/sql/ssms/sql-server-management-studio-ssms), [SQL Server Configuration Manager](/sql/relational-databases/sql-server-configuration-manager), [PowerShell](/powershell/module/sqlserver/start-sqlinstance), or the Services applet.
162158

163-
#### Use SQL Server Configuration Manager
159+
### Use SQL Server Configuration Manager
164160

165161
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.
166162

@@ -169,7 +165,7 @@ To verify that the instance is running, select **SQL Server Services** in **SQL
169165

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

172-
#### Use PowerShell commands
168+
### Use PowerShell commands
173169

174170
Use the following command in PowerShell to check the status of SQL Server services on the system:
175171

@@ -183,18 +179,18 @@ You can use the following command to search the error log file for the specific
183179
Get-ChildItem -Path "c:\program files\microsoft sql server\mssql*" -Recurse -Include Errorlog | Select-String "SQL Server is now ready for client connections."
184180
```
185181

186-
### Verify that the SQL Server Browser service is running
182+
## Verify that the SQL Server Browser service is running
187183

188184
Use one of the following methods to verify that the SQL Server Browser service is running.
189185
> [!NOTE]
190186
> You need this step only when troubleshooting connectivity problems with named instances.
191187
192-
#### Use the SQLCHECK output file
188+
### Use the SQLCHECK output file
193189

194190
1. Search the SQLCHECK output file for "SQL Server Information".
195191
1. In the section titled "Services of Interest", search for `SQLBrowser` in the **Name** column and check its status by using the **Started** column. If the value is **True**, the service is started. Otherwise, the service isn't currently 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).
196192

197-
#### Use SQL Server Configuration Manager
193+
### Use SQL Server Configuration Manager
198194

199195
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.
200196

@@ -205,7 +201,7 @@ For more information about stopping and starting SQL Server services, see [Start
205201
> [!NOTE]
206202
> If you can't run the SQL Server Browser service in your environment, see [Connecting to SQL server named instance without SQL Server browser service](https://social.msdn.microsoft.com/Forums/en-US/edeab7bc-300d-4e19-8767-1c299970d841/connecting-to-sql-server-intance-without-browser-running).
207203
208-
### Verify the server name in the connection string
204+
## Verify the server name in the connection string
209205

210206
You often encounter errors when you specify an incorrect server name in the connection string. Make sure that the server name matches the one that you retrieved in the previous steps.
211207

@@ -215,14 +211,14 @@ You often encounter errors when you specify an incorrect server name in the conn
215211
- For examples of connection strings, see [SQL Server Connection Strings](https://www.connectionstrings.com/sql-server/).
216212
- For more detailed examples, see [Proof of concept connecting to SQL using ADO.NET](/sql/connect/ado-net/step-3-connect-sql-ado-net) under [Homepage for SQL client programming](/sql/connect/homepage-sql-connection-programming).
217213

218-
### Verify the aliases on the client machines
214+
## Verify the aliases on the client machines
219215

220216
Aliases are often used in client environments when you connect to SQL Server with an alternate name or when there are name resolution issues in the network. They're created by using [SQL Server Configuration Manager](/sql/tools/configuration-manager/new-alias-alias-tab) or [client network utility](/previous-versions/windows/desktop/odbc/dn170543(v=vs.85)). An incorrect alias can cause the connections from your applications to connect to the wrong server, resulting in failure. Use the following methods to check for incorrect aliases. You can also use a tool (such as [SQLCHECK](https://github.com/microsoft/CSS_SQL_Networking_Tools/wiki/SQLCHECK)) on the client machine to check for aliases and various other connectivity-related settings on a client machine.
221217

222218
> [!NOTE]
223219
> 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.
224220
225-
#### Use the SQLCHECK output file
221+
### Use the SQLCHECK output file
226222

227223
1. In the SQLCHECK output file, search for the string `SQL Aliases`. This string is inside the **Client Security and Driver Information** section of the file.
228224
1. Review the entries in the table. If no entries are 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.
@@ -240,7 +236,7 @@ prodsql TCP prod_sqlserver 1430
240236

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

243-
#### Check aliases in SQL Server Configuration Manager
239+
### Check aliases in SQL Server Configuration Manager
244240

245241
1. In [SQL Server Configuration Manager](/sql/relational-databases/sql-server-configuration-manager), expand **SQL Server Native Client Configuration**, and select **Aliases**.
246242
1. Check whether any aliases are defined for the server that you're trying to connect to.
@@ -256,19 +252,19 @@ The output indicates that `prodsql` is an alias for a SQL Server called `prod_sq
256252
- When connecting to a default instance named _Mydefaultinstance_, the pipe name should be _\\\\Mydefaultinstance\pipe\sql\query_.
257253
- When connecting to a named instance _MySQL\Named_, the pipe name should be _\\\\MySQL\pipe\MSSQL$Named\sql\query_.
258254

259-
#### Check aliases in SQL Server Client Network Utility
255+
### Check aliases in SQL Server Client Network Utility
260256

261257
1. Open [SQL Server Client Network Utility](/previous-versions/windows/desktop/odbc/dn170535(v%3dvs.85)) by typing _cliconfg.exe_ in your Run command.
262258
1. Follow step 2 in [Check aliases in SQL Server Configuration Manager](#check-aliases-in-sql-server-configuration-manager).
263259

264-
### Verify the firewall configuration
260+
## Verify the firewall configuration
265261

266262
You can verify the firewall configuration depending on the default instance or named instance.
267263

268264
> [!NOTE]
269265
> If you're using third-party firewalls in your network, the concepts still apply. However, you might need to work with your network administrator or consult the firewall product's documentation for more information about configuring the firewall to allow necessary ports for communication with SQL Server.
270266
271-
#### Default instance of SQL Server
267+
### Default instance of SQL Server
272268

273269
A default instance typically runs on port 1433. Some installations also use a non-standard port (other than 1433) to run SQL instances. The firewall might block either port. To check the port number, follow these steps:
274270

@@ -279,7 +275,7 @@ A default instance typically runs on port 1433. Some installations also use a no
279275
- If the connection doesn't work, the firewall is blocking the port. You can follow the instructions at [Configure a Windows Firewall for Database Engine Access](/sql/database-engine/configure-windows/configure-a-windows-firewall-for-database-engine-access) or work with your network administrator to add the port to the firewall exclusion list.
280276
- If the connection works, the firewall is allowing communication through that port. You need to change your connection string to use the port number and your server name in the connection string of your application.
281277

282-
#### Named instance of SQL Server
278+
### Named instance of SQL Server
283279

284280
If your SQL instance is a named instance, it might be configured to use either dynamic ports or a static port. In either case, the underlying network libraries query the SQL Server Browser service running on your SQL Server machine through UDP port 1434 to enumerate the port number for the named instance. If a firewall between the client and the server blocks this UDP port, the client library can't determine the port (a requirement for connection) and the connection fails. To check the connection, you can use one of the following methods:
285281

@@ -299,11 +295,11 @@ If your SQL instance is a named instance, it might be configured to use either d
299295
- Scenario 1: Dynamic ports. In this case, ensure that the SQL Server Browser service is started and UDP port 1434 isn't blocked on the firewall between the client and the server. If you can't do either of these things, switch your SQL Server instance to a static port and use the procedure documented in [Configure a Server to Listen on a Specific TCP Port](/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port).
300296
- Scenario 2: Static port configuration. Either SQL Server Browser isn't running or UDP 1434 can't be opened on the firewall. In this case, make sure to specify the static port in your connection string and that the firewall doesn't block the port. For more information, review [Configure a Windows Firewall for Database Engine Access](/sql/database-engine/configure-windows/configure-a-windows-firewall-for-database-engine-access).
301297

302-
### Verify the enabled protocols on SQL Server
298+
## Verify the enabled protocols on SQL Server
303299

304300
In some installations of SQL Server, an administrator must manually enable connections to the Database Engine from another computer. Use one of the following options to check and enable the necessary protocols to allow remote connections to SQL Server Database Engine.
305301

306-
#### Use the SQLCHECK output file
302+
### Use the SQLCHECK output file
307303

308304
1. Search the SQLCHECK output file for the "Details for SQL Server instance" section and locate the information section for your SQL Server instance.
309305
1. In the section, find the values listed in the following table to determine if the SQL Server protocols are enabled:
@@ -319,15 +315,15 @@ In some installations of SQL Server, an administrator must manually enable conne
319315
> [!NOTE]
320316
> After enabling a protocol, you must stop and restart the Database Engine for the change to take effect.
321317
322-
#### Use SQL Server Configuration Manager
318+
### Use SQL Server Configuration Manager
323319

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

326322
1. Open the SQL Server Configuration Manager.
327323
1. In the left pane, expand **SQL Server Network Configuration**, and then select the instance of SQL Server that you want to connect to. The right pane lists the connection protocols available. **Shared Memory** is normally enabled. It only works from the same computer, so most installations leave **Shared Memory** enabled. To connect to SQL Server from another computer, use **TCP/IP**. If **TCP/IP** isn't enabled, right-click **TCP/IP**, and then select **Enable**.
328324
1. If you change the enabled setting for any protocol, restart the Database Engine. In the left pane, select **SQL Server Services**. In the right-pane, right-click the instance of the Database Engine, and then select **Restart**.
329325

330-
### Test TCP/IP connectivity
326+
## Test TCP/IP connectivity
331327

332328
To connect to SQL Server by using TCP/IP, Windows needs to establish the connection. Use the following steps to test TCP connectivity by using the ping tool.
333329

@@ -343,7 +339,7 @@ To connect to SQL Server by using TCP/IP, Windows needs to establish the connect
343339
> [!NOTE]
344340
> You can also use either the [Test-NetConnection](/previous-versions/windows/powershell-scripting/dn372891(v=wps.630)) or [Test-Connection](/powershell/module/microsoft.powershell.management/test-connection) cmdlet to test TCP connectivity according to the PowerShell version that's installed on the computer. For more information about PowerShell cmdlets, see [Cmdlet Overview](/powershell/scripting/developer/cmdlet/cmdlet-overview).
345341
346-
### Test local connection
342+
## Test local connection
347343

348344
Before troubleshooting a connection problem from another computer, test your ability to connect from a client application installed locally on the computer that's running SQL Server. A local connection avoids issues with networks and firewalls.
349345

@@ -377,7 +373,7 @@ If you can't install Management Studio, you can test the connection by using the
377373
1. If you can connect by using shared memory but not TCP, fix the TCP problem. The most likely issue is that TCP isn't enabled. To enable TCP, see [Verify the enabled protocols on SQL Server](#verify-the-enabled-protocols-on-sql-server).
378374
1. If your goal is to connect by using an account other than an administrator account, begin by connecting as an administrator. Then, try to connect again with the Windows Authentication sign-in or the SQL Server Authentication sign-in that the client application uses.
379375

380-
### Test remote connection
376+
## Test remote connection
381377

382378
Once you can connect by using TCP on the same computer, try to connect from the client computer. You can use any client application, but to avoid complexity, install the SQL Server Management tools on the client. After installation, try to use SQL Server Management Studio.
383379

@@ -399,7 +395,7 @@ Once you can connect by using TCP on the same computer, try to connect from the
399395
1. On the right-pane, make sure that **TCP/IP** is enabled. If **TCP/IP** is disabled, right-click **TCP/IP** and select **Enable**.
400396
1. Make sure that the protocol order for TCP/IP is a smaller number than the named pipes (or VIA on older versions) protocols. Generally, you should leave shared memory as order 1 and TCP/IP as order 2. Shared memory is only used when the client and SQL Server are running on the same computer. All enabled protocols are tried in order until one succeeds, but shared memory is skipped when the connection isn't on the same computer.
401397

402-
### Check user permissions
398+
## Check user permissions
403399

404400
If you're using Named Pipes to connect, check whether a user has permissions to sign in to Windows. For more information, see [Troubleshooting the Named Pipes connections issue](named-pipes-connection-fail-no-windows-permission.md).
405401

0 commit comments

Comments
 (0)