postgres: client could not connect to server

此生再无相见时 提交于 2019-12-24 08:56:46

问题


For clarification, please note that I have found several similar questions on stackoverflow, but I could not fix my issue.

psql: could not connect to server: Connection refused” Error when connecting to remote database

psql: How to Allow Remote Access to PostgreSQL database

I am trying to connect to a postgres DB installed in a remote server. To create a connection from the client I am using QGIS plugin (Add PostGIS Layer):

The error that occurs is:

could not connect to server: Connection refused (0x0000274D/10061) is the server running on host "localhost" (::1) and accepting TCP/IP connection on port 5432

Additionally I added the host's IP Adress in the Host field, but then another error message occurs:

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "hosts_ip_adress" and accepting TCP/IP connections on port 5432?

My settings are:

  1. Postgres installed version is 10.0 with PostGIS extension
  2. Host operating System: Windows 7
  3. Client operating System: Windows 7

I edited pg_hba.conf to:

host    all             all             0.0.0.0/0               md5

and changes listen parameter in 'postgresql.conf' to:

listen_addresses = '*'

both files are located in C:\Program Files\PostgreSQL\10\data

  1. restartet pgAdmin4

My devices are in the same network. Each one is connected via LAN cable. I suppose that a firewall is preventing the connection?

来源:https://stackoverflow.com/questions/50176520/postgres-client-could-not-connect-to-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!