HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Unable to connect to remote SQL Server instance after thorough troubleshooting

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterconnectserversqlthoroughunableinstancetroubleshootingremote

Problem

I am at the end of my rope troubleshooting a remote SQL Server connection problem. I am a DBA but not a networking expert.

Certain information below has been sanitized using "x" in place of a letter.

I have access to a remote Windows 2008 R2 server through RDP. I connect to this server with the address jxxxxxx.sxxxx:5000. This succeeds.

Using this RDP connection I installed MS SQL Server 2014 Express on the server. This has been upgraded to SP2 Cumulative Update 8. I used the checkbox to install a default, unnamed instance. Using SQL Server Management Studio from the server I can connect to and use this new instance.

I have already performed the following configuration steps:

  • SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for MSSQLSERVER > enabled TCP/IP. I did remember to restart the service by going to SQL Server Services and restarting SQL Server (MSSQLSERVER).



  • In the firewall I created an inbound rule to allow all TCP traffic on 1433.



On my home computer I opened SQL Server Management Studio 2017 and attempted to connect with jxxxxxx.sxxxx. I am unable to connect, receiving the error message below:

Cannot connect to jxxxxxx.sxxxx.

------------------------------
ADDITIONAL INFORMATION:

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)


To troubleshoot this I have gone to extremes:

  • On the server I used SSMS to connect to the instance and checked the instance properties. "Allow remote connections to this server" is checked.



  • I pinged jxxxxxx.sxxxx successfully and tried using that IP address for my home computer's SSMS connection string.



  • In Configuration Manager I right-clicked on the TCP/IP protocol and scrolled down

Solution

Something else you can have a look at is whether the TCP protocol for SQL Server is listening on the correct IP address(es). You can do this from SQL Server Configuration Manager.

Go the same screen where you enabled the TCP/IP protocol, in your case SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for MSSQLSERVER and right-click on TCP/IP. Once the new screen loads, click on the IP Addresses tab, and you will see something similar to this:

The IP that you are connecting to remotely should show up in one of these fields (e.g. IP1, IP2, etc.). To find out what the IP you are using resolves to, run
the following in a cmd session:

C:\Users\hs>nslookup jxxxxxx.sxxxx
    Server:  UnKnown
    Address:  192.xxx.xxx.xxx

    Non-authoritative answer:
    Name:    jxxxxxx.sxxxx
    Addresses:  192.xxx.xxx.xxx <- This is the address


By default SQL Server listens on all addresses, but in some cases, the default isn't used and addresses need to be explicitly added. Note that if you are using NAT or port-forwarding, you might not see the external IP, in which case you will need to work with your network administrators to make sure the translation or forwarding address is correct.

Code Snippets

C:\Users\hs>nslookup jxxxxxx.sxxxx
    Server:  UnKnown
    Address:  192.xxx.xxx.xxx

    Non-authoritative answer:
    Name:    jxxxxxx.sxxxx
    Addresses:  192.xxx.xxx.xxx <- This is the address

Context

StackExchange Database Administrators Q#190066, answer score: 2

Revisions (0)

No revisions yet.