0

I have created a db instance (sql server ex) in my AWS account and now trying to access it via MS SQL Server Management Studio or via Visual Studio Server Explorer, but i can't, i get the errors like below:

enter image description here

enter image description here

I have added my ip address in inbound under security group as well: enter image description here

Elnoor
  • 3,401
  • 4
  • 24
  • 39
  • 2
    Is your RDS instance "publicly accessible" and in a public subnet? – Matt Houser Feb 02 '18 at 23:23
  • Notice: your second and third rules are allowing anyone access. Delete those two rules. Verify that your home router security setting is not blocking port 1433. To verify turn off the router's firewall temporarily so that you can test. – John Hanley Feb 03 '18 at 02:39
  • 1
    You're not adding `,1433` to the hostname somewhere by chance are you? That's an odd way for the error message to show a port number. – Michael - sqlbot Feb 03 '18 at 03:28
  • @MattHouser thanks a lot. I created a new db instance with public accessibility and could connect it fine. Subnets are coming as default from my default VPC. The db instance that i was trying to connect earlier was created privately i think, but i had played around it and i believe i had changed it to be publicly accessible, but still hadn't had a chance to connect. Unfortunately it is deleted now, so i can't try with the same old instance. – Elnoor Feb 04 '18 at 22:12
  • @JohnHanley I am aware of those, they were they on purpose to test. That wasn't a firewall problem but i believe like Matt said it was a "publicly accessible" problem – Elnoor Feb 04 '18 at 22:15
  • @Michael-sqlbot i was indeed adding the port number, that is an optional parameter. – Elnoor Feb 04 '18 at 22:16
  • Maybe this is a Windows thing, but the typical convention is for port numbers to be preceded by `:`, not `,`. Does anything change if you remove it? – Michael - sqlbot Feb 04 '18 at 22:38
  • @Michael-sqlbot i have seen them both in use. But anyways i checked all 3 combinations (no port ";" ","), none worked. You can check for "," usage here https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToMicrosoftSQLServerInstance.html – Elnoor Feb 04 '18 at 22:49

1 Answers1

0

I Tried all the above steps but didn't work. Even though, i have selected 'Publicly Accessible' while using visual studio, it didnt reflect in the aws console. So, the below steps worked for me. Please try this.

Note:- this is only for my testing/learning purposes. So, i made it publicly accessible. You might not enable publicly accessible if there is a security issue. If you are testing/using for learning purposes, you can follow the below approach.

Make sure your port is publicly accessible .Else you will not be able to connect.

To enable the public accesss, please follow the below steps.

  1. Select the db instance --> click Modify

Modify instance

  1. Scroll to connectivity Section, expand 'Additional configuration' section --> select 'Publicly Accessible'--> Scroll to bottom --> select update. (as shown below). enter image description here
  1. Your db instance will be in modifying state and after 2-3 minutes it will be available. Now, give it a try to connect again and you will be able to connect now.
Krishna
  • 7,290
  • 3
  • 25
  • 25