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.

4
  • 2
    Can you connect using psql using those parameters?
    – user1822
    Commented Jun 1, 2015 at 6:59
  • Nope :( I don't get it, these are correct, maybe I'm missing something else?
    – NeoVe
    Commented Jun 6, 2015 at 7:55
  • psql -U user_ -h xxxxx.amazoncode.us-east-1.rds.amazonaws.com db - Nothing...
    – NeoVe
    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.
    – sivann
    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.
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.