Cannot connect to SQL Server database

0

In RDS I used Easy Create to create a SQL Server database - SQL Express version. I then modified the database to make it publicly available.

  • I used the default VPC Security Group and added an inbound rule for TCP over port 1433.
  • I copied the endpoint for the database (referred to below as <endpoint text>)
  • I opened up SSMS on my laptop and attempted to connect (using SQL Server security) to the db server as follows: <endpoint text>,1433
  • I am unable to connect to the server this way - the error is "the wait operation timed out" - error 258. "The server was not found or is not accessible."
  • I've followed all the steps in the troubleshooting documentation but am not getting anywhere.

Thanks!

2 回答
0
已接受的回答

A timeout issue in AWS is generally a network problem. A few of things that we can check.

  1. Have you associated the default security group with the mysql server ?
  2. What is the CIDR that you have added in the security group inbound rule ? It is supposed to be your ip address or 0.0.0.0/0.
  3. Have you enabled public accessibility on your server ? It is necessary for the server to have a public ip to be reachable from your local. You can use the dig command to get the ip of the endpoint and verify it is a public address.
  4. If all the above points have been checked and it still doesn't work, the route table associated with the database subnets need to be checked. They should have a route for all traffic going towards 0.0.0.0/0
sagar
已回答 2 年前
AWS
专家
已审核 2 年前
  • Thank you Sagar for your quick and careful answer. I've checked and double-checked all the points you brought up. I'm thinking the problem may be on my side rather than Amazon's: the communication is being blocked at my laptop - even though I've configured the McAfee firewall to enable traffic through port 1433. When I try to connect from my laptop to my own SQL instance, remotely (i.e., specifying <MyComputerName>,1433), I get the same error. I'm at a loss what to do since configuring my firewall does not seem to work. Any thoughts would be welcome!

0

There is a lot of excellent troubleshooting documentation on AWS on the database connection failures. It pretty much covers the points that Sagar made. None of it, to my knowledge, mentions the VM or server that belongs to your EC2 instance. Once I opened the 1433 port on the server, the problem was solved. The resolution for my laptop, which I mentioned in the question, was more complex: there were adjustments required that I assume AWS takes care of under the covers.

TedF
已回答 2 年前
  • Sorry, my above comment was wrong. The EC2 instance had nothing to do with the database or access to it, in fact I've dropped the instance. When I opened up 1433 on the instance I could then access the database but when I dropped the instance I can still access the db. No idea what was going on, since I had taken all the recommended steps for access. So I am marking your answer as Accepted.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则