Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant connect from workspace by psql #2324

Closed
LordJohn42 opened this issue Oct 13, 2019 · 5 comments
Closed

Cant connect from workspace by psql #2324

LordJohn42 opened this issue Oct 13, 2019 · 5 comments
Labels

Comments

@LordJohn42
Copy link

LordJohn42 commented Oct 13, 2019

Info:

  • Docker version: 18.09.6, build 481bc77
  • Laradock commit: 04c6aaf
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu 16.04 (Digital Ocean droplet)

Issue:

Cant connect to postgres from workspace.

Try command:

psql
## OR
psql -H localhost
## OR
psql -U default


psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Expected behavior:

Succesful connect to postgres db.


Reproduce:

psql


This is really simple error. But i dont understand, what im doing wrong.

@DesarrolloJulio
Copy link

Hello, I try to log in to psql and send me this message
sudo docker-compose exec postgres psql -U gamest -d gamest
psql: error: could not connect to server: FATAL: role "gamest" does not exist

@shov
Copy link
Contributor

shov commented Nov 28, 2019

@LordJohn42 from inside of the workspace container you should connect not to localhost but to postgres

  • Make sure you workspace and postgres are both running docker-compose ps
  • Go into the workspace docker-compose exec workspace bash
  • Connect psql -U default -h postgres -p 5432 default
    ps check the creds in your .env and the port in output of ps

@stale
Copy link

stale bot commented Feb 26, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Feb 26, 2020
@LordJohn42
Copy link
Author

@shov Thank you.

@parmonov98
Copy link

parmonov98 commented Feb 7, 2023

getting this error after psql -U default -h postgres -p 5432 default inside workspace container
psql: error: FATAL: password authentication failed for user "default"

POSTGRES_VERSION=alpine
POSTGRES_DB=default
POSTGRES_USER=default
POSTGRES_PASSWORD=secret
POSTGRES_PORT=5432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants