I'm trying to connect postgresql
and pgadmin4
work together.
pgadmin4
works fine but when I try to create a new server I have 2 problems:
- if the
postgres
container is at other port that is not 5432 it dont recognize that port. It show this error:could not connect to server: Connection refused Is the server running on host "172.17.0.5" and accepting TCP/IP connections on port 5431?
- if the
postgres
container is at port 5432 the error isFATAL: password authentication failed for user "example"
.
I execute this command to get postgres
container: docker run -p 5431:5432 --name postgres2 -e POSTGRES_PASSWORD=ad1234 -d postgres
.
I try, following other responses in stackoverflow, adding this command -c"listen_addresses='*'"
and I enter in the config file too but noone of this work to me.
Hope you can help me, thanks.
EDIT [Solved]
Ok I solved, it was a big fail by my part. I was using 172.17.0.5
(the IP container address) and what I need to use to connect is 172.17.01
(the Gateway).
Thanks for you time.