F
F
flov2018-08-14 09:41:26
PostgreSQL
flov, 2018-08-14 09:41:26

How to connect to remote postgresql?

Good afternoon, I can not log in remotely to postgres (locally). The postgres itself hangs on the host 192.168.252.10, I connect from 192.168.252.16. Configs: pg_hba.conf Added the last line.

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            ident
host    replication     all             ::1/128                 ident
host    all             all             192.168.252.0/24        md5

postgresql.conf Changed only this line.
listen_addresses = '*'          # what IP address(es) to listen on;

I connect like this:
psql --host=192.168.252.10 --port=5432 --username=user --password --dbname=db

The error is like this:
psql: FATAL:  password authentication failed for user

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question