Click here to Skip to main content
15,907,325 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I have set my initial settings to public... then my security groups to allow all... then my acl is set to allow all... but right under it * all deny is right there.... fml

Any ideas? Mysql connects but sql\postgres just hate the world. im so lost at this point. stack overflow just hits downvote to EVERY question relating to this.'

It is EXTREMELY unclear how to "Add" policies to an instance. Most people say to do something, like make sure the network gateway is set correctly but never explain how.

What I have tried:

Creating a Microsoft SQL Server DB Instance and Connecting to a Database on a Microsoft SQL Server DB Instance - Amazon Relational Database Service[^]

tried posting on SO... tried their forums... 90% of the solutions are group security policy... tried following along, a working youtube video. that worked for him but not me. tried turning off my firewall, their awful troubleshooting guide.

Any ideas?
Posted
Updated 6-Mar-17 17:51pm
Comments
Dave Kreskowiak 6-Mar-17 20:46pm    
Contact Amazon AWS Support?
Dave Kreskowiak 7-Mar-17 9:45am    
And you wonder why you've been getting down-voted everywhere...

1 solution

So I'm making an assumption you want sql server and not mysql/postgres based on the title of your question saying sql server express.

Also, I'm assuming your DB is on RDS but you are trying to connect to it from your local machine.

Some things to check


  • Check to make sure your instance is marked as "public"

    • In the RDS portion of console, select the desired rds instance of sql server, on the expanded row you should see three icons on the left. Click the middle icon that looks like a magnifying glass over a document
    • You should now be on Configuration details for your chosen instance. Look for the attribute of "Publicly Accessible" under the Security and Network header
    • This "Publicly Accessible" should be marked as "Yes", if it says "No" there is your problem.

  • Check your security group tied to your RDS instance, this is located in the same tab as the above step

    • Look for your IP address, have you added it as with a /32 at the end? For example, if your IP address is 172.9.9.123 then you should add it to your ACL as 172.9.9.123/32
    • Check your ports listed in this ACL
  • The most obvious one, you mentioned that there is a Deny all item
  • Another debugging option, try creating an EC2 instance on your AWS account, attempt to connect to it from your newly created EC2 instance. EC2 doesn't need your RDS instance to be marked as public, you'll just need to make sure you've added the necessary ports to windows firewall on your EC2 instance you create. If this doesn't work, then you'll want to contact support, this should be the benchmark (in my opinon) to decide if the issue is you or amazon

    • Try the following powershell script for testing it via your local and EC2
    • C#
      [CmdletBinding()]
      Param(
      	[Parameter(Mandatory=$True)]
      	[string]$ServerName,
      	
      	[Parameter(Mandatory=$True)]
      	[string]$DatabaseName,
      
      	[Parameter(Mandatory=$True)]
      	[string]$Username,
      
      	[Parameter(Mandatory=$True)]
      	[string]$Password
      )
      
      $connectionString = [string]::Format( "server={0};database={1};uid={2};pwd={3};", $ServerName, $DatabaseName,$Username,$Password) 
      
      $conn = New-Object system.Data.SqlClient.SqlConnection
      $conn.connectionstring = $connectionString
      $conn.open()
      
      switch ($conn.State)
      {
      "Open" { Write-Host "Connection Works"; }
      Default { Write-Host "The connection is $($conn.State). Error connecting to DB. Check windows firewall or RDS white list."; }
      }




Creating an RDS instance and connecting it to it is really simple. Either you've managed to find an insane bug in AWS or there is some setup item that has been overlooked.

You shouldn't have to fiddle with your VPC or any of that other more advanced items within AWS unless you've got a super complicated AWS setup.
 
Share this answer
 
Comments
David_Wimbley 7-Mar-17 12:58pm    
With this kind of reply, you wonder why no one wants to help you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900