Sultan Roziyev
Sultan Roziyev

Reputation: 21

I can't connect to a remote postgresql database

The error itself: psql: error: connecting to server "10.10.99.1", port 5432 failed: FATAL: no pg_hba.conf entry for host "10.10.99.3", user "eprt_admin", database "postgresql", SSL encryption failed to connect to server "10.10.99.1", port 5432: FATAL: no pg_hba.conf entry for host "10.10.99.3", user "eprt_admin", database "postgresql", no encryption

pg_hba.conf:

#IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
host    all         eprt_admin  10.10.99.3/32       md5
host    all         eprt_admin  10.10.99.1/32       md5
#IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256
#Allow replication connections from localhost, by a user with the
#replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256

Upvotes: 0

Views: 158

Answers (1)

Nurzamat
Nurzamat

Reputation: 24

Add or edit the following line in your postgresql.conf :

listen_addresses = '*'

Restart Postgresql after adding this with service postgresql restart or the equivalent command for your setup.

source: https://dba.stackexchange.com/questions/83984/connect-to-postgresql-server-fatal-no-pg-hba-conf-entry-for-host

Upvotes: 0

Related Questions