Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Pgadmin3 to a database on Virtualbox machine?

I have an Ubuntu Server with Postgresql server on Virtualbox machine (which runs on local machine), and Pgadmin3 on local machine. Now how can I connect with Pgadmin3 to a database on Virtualbox? I am getting

"Server doesn't listen"

Postgres is actually running inside Virtualbox.

like image 947
atman Avatar asked May 21 '13 08:05

atman


1 Answers

Found this out. To make it work, i did:

1) Edited file /etc/postgresql/9.1/main/postgresql.conf , uncommented and edited one line to contain:

listen_addresses = '10.10.4.14,localhost'

Where 10.10.4.14 is address used to access server on virtualbox.

2) Edited file /etc/postgresql/9.1/main/pg_hba.conf , added one line at the end:

host     all             all             10.10.4.14/24           md5

Note file path in your case might be different if your Postgres version is not the same as mine, or another linux distribution might place those files in other locations.

like image 132
atman Avatar answered Nov 01 '22 09:11

atman