2

I am very new to AWS/Elastic Beanstalk/RDS but I can't figure out why I am unable to connect to my Postgres DB via Postico.

As far as I can tell, I am entering the correct credentials found under "Environment Properties" in the AWS dashboard.

When I run psql statements from the terminal (ssh'd in here as "ec2-user@ip-*****") it says "command not found". But my site is actually up and working. And according to the RDS tab on AWS it is definitely using Postgres.

When I try and connect using Postico (not via SSH), it just hangs for ages and then times out. No error! I'm using the same user, password, and host names stored in the "Environment Properties". I'm even using port 5432.

What can I try?

1 Answer 1

4
  1. Go to the RDS Dashboard
  2. select 'DB Instances'
  3. click the toggle in the LH column under "filter" next to database you wish to attach to
  4. Copy the "Endpoint" setting ie postgres-db.ba2syxhcyfxx.eu-west-1.rds.amazonaws.com:5678
  5. on your EC2 shell as root issue command yum install postgresql
  6. in your shell on an EC2 issue command psql -h postgres-db.ba2syxhcyfxx.eu-west-1.rds.amazonaws.com -p 5678 -U myuser

Where "myuser" is the user you wish to attach as

Sign up to request clarification or add additional context in comments.

3 Comments

added step to answer for installing postgresql client software. Hopefully yum is set up...
If you receive errors like: No match for argument: postgresql10 or No match for argument: postgresql14 while running sudo yum install -y postgresql<your_version>. Just check what versions persist in repositories using sudo yum search "postgres". In my case there were neither postgresql10 nor postgresql14, but was postgresql15. So I invoked sudo yum install postgresql15 and it worked.
@HereAndBeyond yes, and the same thing applies for postgresql clients on Ubuntu

Your Answer

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.