Question :
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.
Answer :
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 onrds-launch-wizard (sg-3e9axxx)
which leads you to the EC2 Dashboard in theSecurity Groups
panel. - Select your security group and open the
Inbound
Tab in the lower panel. - Click on
Edit
andAdd Rule
. Don’t forget to set thePort Range
to 5432 and selectMy IP
in the source. - Click on
Save
. - You should be able to connect to your RDS Instance from your local IP.