Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? [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 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).

Related

pg_hba.conf - client side fatal error [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 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.

Setting up Postgres: Can't connect remotely to Postgres server (debian) [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 having problem with connect with database from outside server. I read a lot of topics about of this subject. And nothing...
Postgresql 8.4 / Debian
My /etc/postgresql/8.4/main/postgresql.conf:
listen_addresses = '*'
port = 5432
max_connections = 100
My /etc/postgresql/8.4/main/pg_hba.conf:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 trust
netstat -nlp | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 6520/postgres
tcp6 0 0 :::5432 :::* LISTEN 6520/postgres
unix 2 [ ACC ] STREAM LISTENING 15338180 6520/postgres /var/run/postgresql/.s.PGSQL.5432
telnet localhost 5432
Trying 127.0.0.1...
Connected to localhost.localdomain.
But when I try connect from my computer I always get "Failed to establish a connection to".
Any idea what I am doing wrong ? :/ Thanks for yours help :)
Did you disable the firewall on the server on which postgres is running?
If not, disable and test. If you are able to connect after the firewall is disabled, you need to open the port 5432 in your firewall.
Check the obvious like IPTABLES, ensure this is not running:
iptables -L
http://wiki.debian.org/iptables
If it's running and the default rules are in place, then this could cause issues.

Open Port 3306 via SSH [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 a Remote MySQL database from a GoDaddy VPS. I have enabled remote access on my server but I need to open the 3306 port on GoDaddy's VPS. I was told by their suppor I would need to do this via SSH but they were not able to help me any further than that. I have successfully connected to my server via SSH. I have run the following command:
telnet myserver.com 3306
When I rund that command I get the following message, SHost is not allowed to connect to this MySQL serverConnection closed by foreign host.
How do I open the port to allow me to connect to a Remote MySQL database?
Use port forwarding.
ssh -L 3306:localhost:3306 myserver.com
(I assume you normally ssh to your server by running ssh myserver.com.)
Then, while that connection is active, connect to the database on localhost instead of myserver.com (e.g. test using telnet localhost 3306).
More details in the ssh manual.

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