Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable postgresql-9.6 for remote connectivity

Tags:

postgresql

I have installed CentOS 7 on vmware on my Windows 8 PC. I am able to connect through F-secure from my host machine, but I am not able to connect my pgAdmin to Postgres 9.6 which I installed on my CentOS 7.

like image 233
Usman_Enterprise_Developer Avatar asked Jan 10 '17 14:01

Usman_Enterprise_Developer


People also ask

How do I connect to a PostgreSQL database from another machine?

To connect to PostgreSQL from a different machine, you must open port 5432 for remote access. Refer to the FAQ for more information on this. IMPORTANT: By default, the database port for the nodes in this solution cannot be accessed over a public IP address.

How do I enable port 5432?

Open Windows Firewall Port As an alternative you can go to Control Panel -> Systems and Security -> Windows Firewall -> Allow a program or feature through Windows Firewall -> Advanced Settings -> New Rule: Rule Type: Port. TCP or UDP: TCP. Specific local ports: 5432.


2 Answers

you can ask it from postgres by logging into it and then use SHOW config_file; like this:

postgres=# SHOW config_file;
               config_file
------------------------------------------
 /etc/postgresql/9.6/main/postgresql.conf
(1 row)

this link might help you.

like image 87
S.Hossein Asadollahi Avatar answered Oct 04 '22 03:10

S.Hossein Asadollahi


Maybe it's work for you

# /var/lib/pgsql/9.x/data/pg_hba.conf
host    all         all         0.0.0.0/0    md5

# vi /var/lib/pgsql/9.x/data/postgresql.conf
listen_addresses = '*'

# sudo systemctl restart postgresql-9.x.service

Hope this help or you can open this link

like image 39
gobliggg Avatar answered Oct 04 '22 05:10

gobliggg