0

I am trying to connect to my database on a remote server using QGIS. From what I've read I have to edit the pg_hba.conf and the postgresql.conf files. I think I have edited these files to allow any IP to connect using the password (not very secure but I'll sort that out when I get this issue figured out). I have verified that my parameters in the PostGIS connection tool are correct.

When I try to connect to the database it says theres an error. I'm not sure if I missed a step or if I did anything incorrect, can anyone give me some suggestions on how to get this accomplished?

# IPv4 local connections:
host    all             all             0.0.0.0/0            md5
# IPv6 local connections:
host    all             all             ::0/0                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    replication     all             0.0.0.0/0            md5
host    replication     all             ::0/0                 md5

Versions: QGIS 3.4.14, PostgreSQL 10, pgAdmin 4

OS: Client side -> Windows 10, Server side -> Windows Server 2012

  • 2
    You said you have an error, but you didn't give it to us. – etrimaille Jan 20 at 19:34
  • 3
    Make sure set the line listen_addresses = '*' # what IP address(es) to listen on; in postgresql.conf and to restart the server (note: I strongly discourage against * and 0.0.0.0/0 as it means your DB is an open bar for everybody) – JGH Jan 20 at 19:35
  • @JGH I do have listen_addesses set to '*'. I do plan on changing the 0.0.0.0/0, should I change it to the IP of my local desktop? – ram_nl Jan 20 at 19:46
  • yes! (if local), or your router IP or your company IP, and then use a /32 (or /24 if your local IP do change a bit). Also if exposed to the web, don't allow all users but only specific one(s) – JGH Jan 20 at 19:50
  • 1
    please add the error and operating systems used client and server side (can vary the answer) – Mapperz Jan 20 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.