2

I am getting started on AWS RDS. I am trying to create a public PostgreSQL instance (free tier) and trying to connect from my local laptop through SQL Workbench. I am following the instructions from this https://aws.amazon.com/getting-started/tutorials/create-connect-postgresql-db/

But, when I try to connect from SQL Workbench, I get "connection attempt failed" error. I have verified the steps, host name, port, dbname to make sure I am not missing any. I am still unable connect from SQL Workbench.

Do I have to take care of any other configurations? Is there a way to debug if the rds db instance is reachable (ping/telnet)? Appreciate any help with this. Thank you!

Jesu Benin
  • 27
  • 1
  • 6

3 Answers3

2

You should check the following on the Amazon RDS instance:

  • It is set to publicly accessible
  • It is in a public subnet
  • It has a security group configured to permit inbound access from your IP address on port 3306
  • Your local network is not blocking the connection (try it from home, or tethered via your phone)
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thank you! Looks like it is my local network. Trying from another machine, which is not in network, worked. Is there a way to know what settings in my network blocks it? – Jesu Benin Dec 18 '19 at 22:45
  • It might also be blocked on your local computer itself (firewall settings). You'll have to speak with your Network Admins to figure it out. – John Rotenstein Dec 18 '19 at 22:47
  • Thanks, this helped me! For RDS>Databases>PostgreSQL, enabled - publicly accessible, set the same security group with my EC2>Instances, then added port 5432 (automatically determined by PostgreSQL) for all IPv4 - 0.0.0.0/0, in the used security group – Алексей Добров May 17 '22 at 08:13
1

SQL Workbench was a MySQL client GUI last time I checked. So it is not surprising if it cannot connect to a database forked from PostgreSQL.

Try psql or some other PostgreSQL client software.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
0

I had two issues I had to fix to make it work:

  1. I was reusing a security group previously configured for MySQL and it had only MySQL port configured. I had to add a rule for Postgres port. It seems to be a pretty common issue mentioned in other answers for rds connectivity. That has fixed timeout but did not fix connectivity in general.
  2. One more issue I haven't seen anywhere - I was trying to use a custom "Master username". That didn't work. But when I left a default "postgres" value - I was able to connect.
sarh
  • 6,371
  • 4
  • 25
  • 29