Link to home
Start Free TrialLog in
Avatar of pzozulka
pzozulka

asked on

Connect to SQL Server Error

I am trying to connect to a SQL Server and am getting an error. The servers I tried connecting to are in Amazon AWS, and in Azure. Neither are working. I tried from a different computer, and it works fine, so I know it's a config issue on my machine.

Server:
publicwebapi.c2ugk9t6pzbr.us-west-2.rds.amazonaws.com

Error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server ws 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)

The network path was not found

* I don't have any AV software installed, just Windows Defender.
* I created an outbound rule to allow all connections on outbound 1433
* The SQL instance I installed is LocalDB, so I don't have any SQL services running.

Does this mean I can't connect to remote databases?
Avatar of arnold
arnold
Flag of United States of America image

What are you using to connect, the issue is because the client connection is trying to use named pipes versus TCP/ip which is likely why it can not connect to the remote SQL instance/host.

You need TCP/ip set as the means?
Are you using a DSN?
Avatar of pzozulka
pzozulka

ASKER

I am trying to connect using the 2014 SQL management studio.

The configuration manager shows tcp enabled and named pipes enabled.
Before you connect, look at the option in the ssms interface, and make sure the TCP/ip is selected, then connect.
Not sure what is DSN
Where is the tcp option you are referring to in ssms
In ssms, advanced.

Look on the same line where you gave connect, cancel, or OK, there is another button that deals with the client connection options I.e. Named pipes, TCP/ip, dynamic or specific port etc.  do not have a view  using this interface to .........
Dsn (odbctab) where you define a local identifier that includes within the server, database/schema and means to connect, username/password, etc.
After coming home, it seems to be working after specifying to use tcp in advanced settings of ssms. However, it all of a sudden works from my asp.net application as well.

When Ibsaid earlier that I tried it on another computer and it worked, that other computer was on a different network. I'm wondering if there was a firewall blocking my connection attempts. I'll try this theory today.
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The error states that it is a named pipes issue. I wonder if the public wifi network i was on was blocking outbound port 1433. The SQL server management console shows tcp and named pipes enabled, and tcp is order #2 while named pipes is #3. Is it possible that since tcp didn't work out (because of blocked outbound 1433 traffic) it went ahead with named pipes?
The setting on the server/order means nothing iMHO.
If the client initiated a TCP/ip connection, the error would have reflected that.

If you return and the issue remains, than something else is in play.
So as I mentioned earlier, this has worked all week no problem. I just returned to the wifi network where the original problem occurred last week, and it's not working again. So I'm going to assume port 1433 is blocked outbound on this network.
Or it is being blocked on the remote side i.e. only permitted from specified location.
check the AWS to see whether you have an option to configure/restrict from where connections can be made to the SQL server.
That's the first thing I thought of as well last week, so configured remote side to accept connections from entire world. Yes not secure :)
Look into whether you can establish a VPN connection to the aws setup.......