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
Tuesday, August 22, 2017
Solved: Cannot connect Postgre in VM from host
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment