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

The instance '****.**.**:3306' cannot be added to an InnoDB cluster because it has asynchronous (source-replica) replication channel(s) configured. MySQL InnoDB Cluster

  Error :    MySQL  JS > dba.checkInstanceConfiguration("root@192.*.*.*")  NOTE: Found unexpected replication channel '...