问:
Hi.
I've been having a problem where in Navicat the postgresql connection keeps failing. I have tried everything I can think of (I'm no expert) and I have seen posts of others having the same/similar problem, but have solved it and have not giving any info on how.
I have tried a lot of things and would rather not at the moment because I'm afraid further experiments of mine may cause me to go backwards instead of going forwards. Anyone who knows the solution would be helpful.
I have changed the config from md5 and trust on the connections and nothing changes.
I have tried other commands that ended up causing the service to fail.
I have fixed my VMware problem where it needed to have a bridged connection.
Every other change I made I also restarted the service and rebooted to see if anything would change.
答:make sure your network settings in vm are set to bridged connection and promiscuous mode is set to allow all
go to /var/lib/pgsql/9.3/data/postgresql.conf
add or make sure this is there: listen_addresses='*'
go to /var/lib/pgsql/9.3/data/pg_hba.conf
make sure these are the only uncommitted entrys in the file.
local all all peer
host all all 127.0.0.1/32 md5
host all all samenet md5
host all all ::1/128 ident
restart pgsql or server
============================
问:
Thanks for reply, but...
What would be the method in allowing promiscuous mode in my virtual machine (VMware). I tried "chmod a+rw /dev/vmnet0" and it said no file or directory found. I went into /etc/sysconfig/network-scripts/ifcfg-eth0 and edited it to have PROMISC=yes. Nothing seems to have a change. If it is changing and it is set to be allowed etc. Then why am I unable to connect with Navicat
答:
look @ your pg_hba.conf @ IPv4 it should look like this.
Code:
# IPv4 local connections:
host all all <your ip>/32 trust
==============================