6

I have a PostgreSQL database on an Amazon RDS instance.

I want to have a local dump of this instance.

So far, I've tried with this:

PGPASSWORD="Password" pg_dump -h mydb.xxxxxx.us-east-1.rds.amazonaws.com -p 5432

But it keeps throwing an error, saying that the server refuse the connection, and check if the server is actually running on port 5432, which is actually doing.

All my credentials and DB path/codes are correct.

Colin 't Hart
9,51015 gold badges37 silver badges44 bronze badges
asked Jun 1, 2015 at 3:21
4
  • 2
    Can you connect using psql using those parameters? Commented Jun 1, 2015 at 6:59
  • Nope :( I don't get it, these are correct, maybe I'm missing something else? Commented Jun 6, 2015 at 7:55
  • psql -U user_ -h xxxxx.amazoncode.us-east-1.rds.amazonaws.com db - Nothing... Commented Jun 6, 2015 at 7:57
  • 1
    Check those: Is your host in the samce VPC as the RDS? Is your RDS configured to be publicly accessible? Does the xxx.us-east....com resolve in a private or public IP from your VM? If it's private, are they on the same subnet/VPC? If all the above are correct check also RDS firewall (security group) settings. Commented Jun 22, 2015 at 10:33

1 Answer 1

10

You must be running in a Security Group firewall problem.

  • Go to your RDS Dashboard, select Instances and open the instance you want to connect to.
  • Look for a line like this : Security Groups rds-launch-wizard (sg-3e9axxx) ( active ). You should be able to click on rds-launch-wizard (sg-3e9axxx) which leads you to the EC2 Dashboard in the Security Groups panel.
  • Select your security group and open the Inbound Tab in the lower panel.
  • Click on Edit and Add Rule. Don't forget to set the Port Range to 5432 and select My IP in the source.
  • Click on Save.
  • You should be able to connect to your RDS Instance from your local IP.
answered Jun 22, 2015 at 8:41
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.