I'm trying to setup a dev env for a small project, but I keep running into the same issue and after looking at many posts that did not solve my issue, I drcided to post.
- My pgAdmin is runnning on mt local machine (not in a container).
- My Postgres database is running in a container.
Unable to connect to server:
connection failed: connection to server at "::1", port 5432 failed: FATAL: password authentication failed for user "myuser"
From the error I assumed I had a typo, but there is none (I double and triple checked) and the password was correct.
I use a docker-compose file to create my container:
version: '3.8'
services:
db:
image: postgres:15
container_name: film-db
restart: unless-stopped
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
pg adming server connection setting
I tried 127.0.0.1 and localhost, but nothing helped.
Password: mypassword (I copied and pasted it just to make sure - but it's not working).
I read about some issues like that, but they had both Postgres and pgAdmin runnning in Docker containers.