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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠