How to Configure PostgreSQL to allow remote connection
Example:
db-srv-10 with ip 192.168.1.1
user database: default postgres
Configure:
find / -name "postgresql.conf"
/var/lib/pgsql/data/postgresql.conf
vi /var/lib/pgsql/data/postgresql.conf
listen_addresses = 'localhost'
with
listen_addresses = '*'
find / -name "pg_hba.conf"
vi /var/lib/pgsql/data/pg_hba.conf
host all all 192.168.1.024 md5
Test:
psql -h 192.168.1.10 -U postgres
db-srv-10 with ip 192.168.1.1
user database: default postgres
Configure:
find / -name "postgresql.conf"
/var/lib/pgsql/data/postgresql.conf
vi /var/lib/pgsql/data/postgresql.conf
listen_addresses = 'localhost'
with
listen_addresses = '*'
find / -name "pg_hba.conf"
vi /var/lib/pgsql/data/pg_hba.conf
host all all 192.168.1.024 md5
Test:
psql -h 192.168.1.10 -U postgres
Komentar