Search This Blog

Tuesday, October 26, 2021

Ubuntu Linux - Connect Postgresql from Psql and also PGadmin Remotely

 Step 1 :

> sudo su

> vi /etc/postgresql/10/main/postgresql.conf

#listen_addresses = 'localhost'
to 
listen_addresses = '*'

>vi /etc/postgresql/10/main/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5

to
host all all 0.0.0.0/0 md5


>sudo ufw allow 5432/tcp
>sudo systemctl restart postgresql


>psql -h localhost -d databasename -U userrolename
...enterpasswordfor-userrolename






No comments:

Hit Counter


View My Stats