Saturday, 1 June 2019

connect postgres Database from remote/client side

Client ip address: 192.168.64.178
Server ip address: 192.168.64.177

1] Enter remote machin ip_address/host_name in pg_hba.conf

# IPv4 local connections:
host    all             all             192.168.64.177/0        md5
host    all             all             192.168.64.178/0        md5

2] Restart postgres service on server side

sudo systemctl restart postgresql-11.service
sudo systemctl status postgresql-11.service

3] Connect from clinet/remote to postgres server.

[postgres@node1 data]$ psql -U myuser -h 192.168.64.177

Password for user myuser:
psql (11.3)
Type "help" for help.
myuser=> select current_user;
 current_user
--------------
 myuser
(1 row)
myuser=> select current_database();
 current_database
------------------
 myuser
(1 row)
myuser=>

No comments:

Post a Comment

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...