3
I am trying to access my Postgresql database, however I am getting the following error message:
I have a virtual machine Debian 8 with postgresql 9.4 installed and I am trying to access via my Windows 7.
I made changes in my files pg_hba.conf and postgresql.conf, but to no avail.
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
host all all 192.168.0.0/24 md5
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Does anyone have any idea what it might be? Thanks in advance.
Try adding the following line:
host all all 0.0.0.0/0 trust
and restart Postgresql– Luídne
Hello, I changed the line but still gives the error. This line would free access for all accesses, correct? Could it be some kind of door lock 5432? Or it has nothing to do?
– Thiago Damico
Maybe so, but is the door really open? This command lists the open doors:
netstat -nl
– Luídne
@Luídne gave the command and the door 5432 did not appear in the list, as I do to open?
– Thiago Damico
The service may not be running. Check using the command
service postgres status
and if you are not running use the commandservice postgres start
and check the door again.– Luídne
Try to rotate the nmap from Windows to see if your virtual machine is exposing port 5432 - you probably need to open the port to be able to access Postgresql from Windows (how to do this depends on the virtualization program: Vmware, Virtualbox, ...).
– user25930
@Luídne, I was able to make it work, when you told me to check the
service postgres status
, I realized it was deactivated. I uninstalled the postgre and installed it again in the hope of starting all over again and working out, and with that I saw that door 5432 was open with the newly installed postgre. When messing with the configuration of pg_hba.conf I realized that the door stopped appearing in netstat. Then I discovered that the error was actually in the file that made the door disappear. With the linehost all all 192.168.0.0/0 trust
I managed to make it work. Thank you!– Thiago Damico