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
tohost 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:
Post a Comment