pg_hba.conf - client side fatal error [closed] - postgresql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a user who gets:
FATAL: no pg_hba.conf entry for host "2002:8c64:7831::8c64:7831" user
"", database "postgis", SSL Off
when trying to retrieve data from Postgres using QGIS 2.0. The user has had a new machine (running 32bit Windows 7). The rest of the estate are currently running XP, and no-one else ius reporting the issue. My pg_hba.conf has all as trusted:
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 trust
Do I need to make any changes to the pg_hba.conf file for a windows 7 client? or what changes do I need to make to get it working?

You are missing allow entries for ipv6, you only allow localhost over ipv6. You should add ::/0 (all addresses) or 2000::/3 (all routable addresses) as well.

Related

Can my web host prevent me from connecting to an external database? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have two servers:
CP server - A website is hosted on a server running cpanel (I only have access to cpanel)
VPS server - A server running ubuntu and postgresql
I am pretty sure I did everything correct when I enabled remote access to the postgres database on the VPS server (I connected successfully from two other machines, on two different IPs). However, when I am running exactly the same PHP-code on the CP server, it fails to connect. I tried using fsockopen on this server. It does not work when I try to connect to the VPS server on port 5432, but works on port 80. On the other machines I tried on, it works on port 5432.
So, is it possible that my web hosting provider (the CP server) is blocking this connection somehow?
The webhosting provider is having firewall installed and its blocking the outgoing connection to the postgresql server.

Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm working on Django. I use PostgreSQL database.
Full error says:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
Do you have any idea?
Wild stab in the dark: You're on a machine with an IPv6 resolver where localhost defaults to the IPv6 address ::1, but listen_addresses in postgresql.conf is set to 127.0.0.1 or 0.0.0.0 not * or you're using an older PostgreSQL built with a C library that doesn't have transparent IPv6 support.
Change listen_addresses to localhost and make sure localhost resolves to both the IPv4 and IPv6 addresses, or set it to ::1, 127.0.0.1 to explicitly specify both IPv4 and IPv6. Or just set it to * to listen on all interfaces. Alternately, if you don't care about IPv6, connect to 127.0.0.1 instead of localhost.
See this Google search or this Stack Overflow search for more information.
(Posting despite my close-vote because I voted the question for migration).

Can't connect to another PC on the same network on a particular port [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to access the postgresql service which is running on my computer (which as you can see in the picture, it is running), from another computer on the same network.
On another computer, I am trying to access port 5432 (on which this service runs) by typing in telnet 192.168.2.102 5432; however it fails to connect. Can someone tell me what the problem might be please?
Read this and this pages of the manual to set up connections to the postgresql server correctly.
Take a closer look at listen_addresses, port configuration in postgresql.conf and security settings in pg_hba.conf.
And dont forget to restart your server after you've updated the config files.

Remote connection to PostgreSQL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have just installed Postgresql 9.1 on windows server 2008. I was trying to connect it from the remote computer on the default port 5432(as I have not changed it), but was not successful. So what are the possible configuration settings changes to made?
You need to update some configuration files. They will be in a sub directory of your postgresql install in the data directory. On Windows most likely C:\Program Files\PostgreSQL\9.1\data
You need to update your postgres.conf file to listen_addresses = '*' so the postgres service can be seen by other machines. See 18.3. Connections and Authentication.
To let any machine connect to postgres pg_hba.conf. The 0.0.0.0/0 says let any ip address connect. You can trim this down so it's only ip ranges on your network. See 19.1. The pg_hba.conf File.
all all 0.0.0.0/0 md5
You should check your Postgresql Configuration file.
Verify the setting for listen_addresses. By default it likely only listens on your loopback address which would not allow you to connect from another machine. The simplest way to get it listening on an external interface is to set it to: listen_addresses = '*'
More info can be found in the documentation here.

Configure PostgreSQL to work for only LOCALHOST or specified ip + port [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I want to configure PostgreSQL to accept connections only from a specified IP. It should not accept requests from any other IP.
The following pg_hba.conf allows local and specified Ip have privilege login,
but reject others。
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host testdb testuser 192.168.1.1/32 md5
host all all 0.0.0.0/0 reject
The easiest way is to make PostgreSQL listen only on localhost for incoming connections. The relevant parameter is listen_addresses in postgresql.conf. The doc is here.
Check the pg_hba.conf file in the data folder of PostgreSQL. This is the client authentication configuration file.
# TYPE DATABASE USER ADDRESS METHOD
host testdb testuser 192.168.1.1 md5
local testdb all md5
Add the above to the pg_hba.conf file