Tuesday, August 22, 2017

Solved: Cannot connect Postgre in VM from host

Used vagrant for setting up the VM, so set private network and port forward in vagrant file as below -
               
                 migration.vm.network "private_network", ip: "192.168.33.10"
                 migration.vm.network "forwarded_port",guest:5432 , host:15432 


1. Use telnet localhost 15432 to see if the port is open (Host)


Still can not connect to PostgresSql running in VM  :(

Then

2. Edit postgresql.conf (Guest)
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

           listen_addresses = '*'


3.  Add following in pg_hba.conf

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all              all            0.0.0.0/0               md5


4. Finally, able to connect to Postgres via localhost:15432

Postgres , Vagrant

0 comments :

Post a Comment

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me