0
votes

I have created a Amazon AWS RDS sql server database.

  1. I have connected the server by sql management studio. From my computer AWS server is connecting successfully as well as from other computer in same network serve. But the PC from other location and different network AWS RDS server is not connecting.

  2. I have created a c# windows application. From my pc it has successfully connected to AWS server and its working perfectly. My connection string is

    Data Source=****.us-east-2.rds.amazonaws.com;Network Library = DBMSSOCN; Initial Catalog=myDB; User ID = username; Password = pass;

    I have installed the setup file to client PC. But from the client PC, it is not connecting to AWS server and show bellow error
    "A network related or instance specified error occurred while establishing a connection to sql server.... "

Any suggestion?

3
Check the client firewall, antyvirus etc. For testing disable everything what can block. I did similar situation and I have to install Managment Studio on customer computer to prove that it was some network foult - not my code. Rooter maybe.Arkadiusz
What is the AWS Security Group setting that is applied to the RDS instance?Mark B
Have you tried this links yet: 1. Unable to connect on AWS - RDS DB : SQL Server 2012 Express (stackoverflow.com/questions/35835203/…) 2. Unable to connect to SQL Server on AWS (dba.stackexchange.com/questions/105509/…) 3.Cannot connect Amazon RDS instance to MS SQL Server Express (social.technet.microsoft.com/Forums/security/en-US/…)Dubois

3 Answers

2
votes

This can happen due to multiple reasons. Two of the most common issues are.

  • AWS Security Group attached to the RDS instance not having Client IP whitelisted.
  • Firewall issue in Clients network firewalls.

Note: To troubleshoot these kind of issues, it will be usefull to setup VPC flow logs.

0
votes

It's almost certainly a firewall issue.

First of all, check inbound rules of your server's security group and make sure incoming connections are allowed from client's IP address (not just from your IP address).

Secondly, many companies restrict outgoing connections to http and https only. In which case, I'm afraid you can't do much about it - your client will have to change firewall rules to allow connecting to the database.

0
votes

I've faced it and I had to manually edit the DB inbound rules (on security group) to accept connections from anywhere.