0
I just wasted an hour of my life trying to figure out why pgAdminIII couldn't connect to the server on localhost
. After trying config edits, starting/stopping the postgresql service, etc., I finally realized only one thing had changed since the last time I used pgAdminIII: I was connected to my VPN.
I'm no network wizard, so that's why I'm asking here: why can't I connect to PostgreSQL (localhost) when I'm actively connected to my VPN provider?
Bonus: what commands/steps can I use to show exactly why?
EDIT:
pg_hba.conf:
...
# CAUTION: Configuring the system for local "trust" authentication
# allows any local user to connect as any PostgreSQL user, including
# the database superuser. If you do not trust all your local users,
# use another authentication method.
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication chris trust
#host replication chris 127.0.0.1/32 trust
#host replication chris ::1/128 trust
OS X version: 10.12.6 (Sierra)
PostgreSQL version: 9.6.3
VPN provider: ExpressVPN
More info is required - including the connect info - mainly hostname (don't post password) used by pgAdminIII. A dump of your pg_hba.conf file and OS details would be useful. I suspect that OpenVPN is a red herring. – davidgo – 2018-03-06T23:23:14.400
@davidgo Added. Sorry about that, I posted without really thinking about config info. The Postgres installation is all default - I didn't change anything. And I'm using ExpressVPN, not OpenVPN. The localhost server is
localhost:5432
(the default). – Chris Cirefice – 2018-03-06T23:39:42.470ExpressVPN is a provider - OpenVPN is a program. ExpressVPN uses OpenVPN. What error are you getting, and do you realise that your postgres config file allows anyone to connect to it from the local system without a password ? The problem is highly unlikely to be related to OpenVPN - but check that your hosts file maps localhost to 127.0.0.1 (or ::1/128) rather then another IP address which is not reachable via the LO interface. Also check if the VPN software is messing with your firewall rules - but this is unlikely – davidgo – 2018-03-07T01:33:21.030