Open Karmenzind opened 4 years ago
Hi
can you test the connection with the database by docker.
You run a base with
You write a Dockerfile file:
FROM postgres:12-alpine
RUN apk add --no-cache openssl
RUN /usr/bin/openssl req -new -text -passout pass:abcd -subj /CN=localhost -out /var/lib/postgresql/server.req
RUN /usr/bin/openssl rsa -in privkey.pem -passin pass:abcd -out /var/lib/postgresql/server.key
RUN /usr/bin/openssl req -x509 -in /var/lib/postgresql/server.req -text -key /var/lib/postgresql/server.key -out /var/lib/postgresql/server.crt
RUN chmod 400 /var/lib/postgresql/server.key
RUN chown postgres.postgres /var/lib/postgresql/server.key
you build and run the Dockerfile
docker build -t test .
docker run -d --name test -p 5432:5432 -e POSTGRES_PASSWORD=secret test -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
you can test the connection, with a pgcli docker
docker run --rm -it dbcliorg/pgcli -h <YourIP> -p 5432 -U postgres -W
you can test the connection, with your pgcli
pgcli -h <YourIP> -p 5432 -U postgres -W
At home the connection is ok
Not sure if relevant, but the ip addresses are different - 11.66.194.51
from the dsn, 10.66.194.51
from your cmd line screenshot
Description
Some of my databases cannot be connected with
pgcli -D <dsn>
from several days ago.But
pgcli -h <ip> -u xxx
works:And here are relavant logs from
.config/pgcli/log
:Your environment
pip freeze
command.