0

I can't access remotely my postgre database. My fellow is making a QT project that access the database from my web-server. It's very close to the problem from this guy: Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

And with some research in google, all solutions point to set the listen_addresses property in postgresql.conf like this: listen_addresses = '*'

and in pg_hba.conf add this line in the IPV4 connections

host all all 0.0.0.0/0 trust

I've already done it, and also have created an exception in ufw 5432/tcp ALLOW x.x.x.x.x

when x.x.x.x is the ip I want to give access.

I've also tried some variants to the configuration above ,like listen_addresses = 'localhost, x.x.x.x' and host all all x.x.x.x/32 md5

Community
  • 1
  • 1
graciano
  • 310
  • 3
  • 10

1 Answers1

2

The error message of the linked question happens only when trying to connect locally. That's what ...running on host localhost... means.

When connecting to a remote host, the client doesn't set localhost in the host field, but the IP address or name of the remote machine (well, unless using a SSH tunnel but it's not mentioned here).

Otherwise please indicate the exact connection parameters of the client and the exact error message.

Daniel Vérité
  • 58,074
  • 15
  • 129
  • 156