Wednesday, 24 January 2018

Connnect to PostGIS db using QGIS - when not on localhost


I"m just getting started with PostgreSQL/PostGIS db (v9.2) and I'm wanting to connect to db while not on the localhost using QGIS. I've been able to connect successfully on localhost, however I'm not sure what I need to do to make this non localhost connection. I'm able to ping the db server from my desktop.



In pgAdmin within the db properties I defined the following privileges:


enter image description here


Then in QGIS here are my connection settings (using postgres username/password, but logged in as my domain user):


enter image description here


I've tried searching the web for this, however all the hits are just coming up with examples of how to connect on localhost. I'm thinking maybe I have to add my domain info as user login?


Thanks



Answer



HOST should be the IP of the POSTGIS/Postgres Location


on Windows you can do ipconfig to get the v4 ip something like 192.0.168.101


You need to allow connections to this server in postgres pg_hba.conf



see http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html


firewalls also need to be adjusted to accommodate successful connections.


You can use the Trust switch


host    all         all         192.168.0.101/32        trust

https://stackoverflow.com/questions/1406025/no-pg-hba-conf-entry-for-host


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...