Thread: could not connect to server: Connection refused (0x0000274D/10061)

could not connect to server: Connection refused (0x0000274D/10061)

From
Anuj Pankaj
Date:

Hi,

 

I installed Postgres 8.1.4 on Linux and postgres server is running and I successfully created database on local machine.

I modified listen_addresses = '*' in Postgresql.conf and however If I try to access postgres through pgAdmin III. I am sticking with an exception.

 

Exception is:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "192.168.9.126" and accepting TCP/IP connections on port 5432?

 

Thanks & Regards,
Anuj Pankaj

 


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Devrim GÜNDÜZ
Date:
On Wed, 2010-09-29 at 18:26 +0530, Anuj Pankaj wrote:
>
> I modified listen_addresses = '*' in Postgresql.conf and however If I
> try to access postgres through pgAdmin III. I am sticking with an
> exception.

Did you restart PostgreSQL after the change?
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachment

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Anuj Pankaj
Date:
Ya, I have restarted the server by "service postgresql restart". I am getting OK sign.

Regards,
Anuj Pankaj


-----Original Message-----
From: Devrim GÜNDÜZ [mailto:devrim@gunduz.org] 
Sent: Wednesday, September 29, 2010 6:42 PM
To: Anuj Pankaj
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] could not connect to server: Connection refused (0x0000274D/10061)

On Wed, 2010-09-29 at 18:26 +0530, Anuj Pankaj wrote:
> 
> I modified listen_addresses = '*' in Postgresql.conf and however If I 
> try to access postgres through pgAdmin III. I am sticking with an 
> exception.

Did you restart PostgreSQL after the change?
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org  Twitter:
http://twitter.com/devrimgunduz

"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited
whichmay be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the
addressee(s)only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this
messageis strictly prohibited. If you have received this electronic message in error please notify the sender by reply
e-mailto and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the
riskof malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious
contentin this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."

www.cybage.com

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Vladimir Rusinov
Date:
Is it really running? (run ps ax | grep [p]ost)

2010/9/29 Anuj Pankaj <anujp@cybage.com>
Ya, I have restarted the server by "service postgresql restart". I am getting OK sign.

Regards,
Anuj Pankaj


-----Original Message-----
From: Devrim GÜNDÜZ [mailto:devrim@gunduz.org]
Sent: Wednesday, September 29, 2010 6:42 PM
To: Anuj Pankaj
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] could not connect to server: Connection refused (0x0000274D/10061)

On Wed, 2010-09-29 at 18:26 +0530, Anuj Pankaj wrote:
>
> I modified listen_addresses = '*' in Postgresql.conf and however If I
> try to access postgres through pgAdmin III. I am sticking with an
> exception.

Did you restart PostgreSQL after the change?
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



--
Vladimir Rusinov
http://greenmice.info/

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Anuj Pankaj
Date:

Below is the output by running the command (ps ax | grep [p]ost)

 

 1118 ?        S      0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data

 1120 ?        S      0:00 postgres: logger process

 1122 ?        S      0:00 postgres: writer process

 1123 ?        S      0:00 postgres: stats buffer process

 1124 ?        S      0:00 postgres: stats collector process

 

Please help to run my postgres on remote manchine through pgAdmin III.

 

Regards,

Anuj Pankaj

 

From: Vladimir Rusinov [mailto:vladimir@greenmice.info]
Sent: Wednesday, September 29, 2010 7:47 PM
To: Anuj Pankaj
Cc: Devrim GÜNDÜZ; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] could not connect to server: Connection refused (0x0000274D/10061)

 

Is it really running? (run ps ax | grep [p]ost)

2010/9/29 Anuj Pankaj <anujp@cybage.com>

Ya, I have restarted the server by "service postgresql restart". I am getting OK sign.

Regards,
Anuj Pankaj



-----Original Message-----
From: Devrim GÜNDÜZ [mailto:devrim@gunduz.org]
Sent: Wednesday, September 29, 2010 6:42 PM
To: Anuj Pankaj
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] could not connect to server: Connection refused (0x0000274D/10061)

On Wed, 2010-09-29 at 18:26 +0530, Anuj Pankaj wrote:
>
> I modified listen_addresses = '*' in Postgresql.conf and however If I
> try to access postgres through pgAdmin III. I am sticking with an
> exception.

Did you restart PostgreSQL after the change?
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin




--
Vladimir Rusinov
http://greenmice.info/


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Christian Ullrich
Date:
* Anuj Pankaj wrote:

> Please help to run my postgres on remote manchine through pgAdmin III.

Do you have a firewall on the database server or anywhere between your
Windows client and the database server that might be blocking the
connections?

--
Christian

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
"Igor Neyman"
Date:
 


From: Anuj Pankaj [mailto:anujp@cybage.com]
Sent: Wednesday, September 29, 2010 8:57 AM
To: pgsql-admin@postgresql.org
Subject: could not connect to server: Connection refused (0x0000274D/10061)

Hi,

 

I installed Postgres 8.1.4 on Linux and postgres server is running and I successfully created database on local machine.

I modified listen_addresses = '*' in Postgresql.conf and however If I try to access postgres through pgAdmin III. I am sticking with an exception.

 

Exception is:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "192.168.9.126" and accepting TCP/IP connections on port 5432?

 

Thanks & Regards,
Anuj Pankaj

 


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com
[I.N.] 
 
 
Do you have proper configuration (that allows network connections) in your pg_hba.conf file?
 
 Regards,
Igor Neyman

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Greg Smith
Date:
Anuj Pankaj wrote:

I installed Postgres 8.1.4 on Linux and postgres server is running and I successfully created database on local machine.

I modified listen_addresses = '*' in Postgresql.conf and however If I try to access postgres through pgAdmin III. I am sticking with an exception.

 

Exception is:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "192.168.9.126" and accepting TCP/IP connections on port 5432?


My guess is that you have the iptables firewall running on this server, and it doesn't allow remote users to connect to port 5432 on this server.  This is usually the case in a default RedHat/CentOS Linux system for example.  On that distribution, if you run system-config-securitylevel as root you'll get to a text interface to change settings around.  Go into the "Customize" section, and add "postgres:tcp" to the "Other ports" section.  Running "service iptables restart" afterwards will make the change active.

On other distributions, you can usually confirm whether this is the problem by running (again as root) "iptables -L".  If you see any "(policy REJECT)" in there, and there isn't also a reference to the postgres port on the list of what is accepted, you'll need to find the firewall reconfiguration tool.

It is possible there's a firewall somewhere else between the server and your system causing the problem instead, but from the fact that you're using the 192.168.*.* block I'd assume your client and the server are on the same local LAN.

-- 
Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services and Support  www.2ndQuadrant.us
Author, "PostgreSQL 9.0 High Performance"    Pre-ordering at:
https://www.packtpub.com/postgresql-9-0-high-performance/book

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Anuj Pankaj
Date:

What am I suppose to change in pg_hba.conf file?

 

Regards,

Anuj Pankaj

 

From: Igor Neyman [mailto:ineyman@perceptron.com]
Sent: Thursday, September 30, 2010 6:49 PM
To: Anuj Pankaj; pgsql-admin@postgresql.org
Subject: RE: could not connect to server: Connection refused (0x0000274D/10061)

 

 

 


From: Anuj Pankaj [mailto:anujp@cybage.com]
Sent: Wednesday, September 29, 2010 8:57 AM
To: pgsql-admin@postgresql.org
Subject: could not connect to server: Connection refused (0x0000274D/10061)

Hi,

 

I installed Postgres 8.1.4 on Linux and postgres server is running and I successfully created database on local machine.

I modified listen_addresses = '*' in Postgresql.conf and however If I try to access postgres through pgAdmin III. I am sticking with an exception.

 

Exception is:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "192.168.9.126" and accepting TCP/IP connections on port 5432?

 

Thanks & Regards,
Anuj Pankaj

 


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com
[I.N.] 

 

 

Do you have proper configuration (that allows network connections) in your pg_hba.conf file?

 

 Regards,

Igor Neyman


"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com

Re: could not connect to server: Connection refused (0x0000274D/10061)

From
Tom Lane
Date:
Anuj Pankaj <anujp@cybage.com> writes:
> What am I suppose to change in pg_hba.conf file?

If you're getting "Connection refused", no amount of changing
pg_hba.conf will change the result, because that's not where your
problem is.  This error implies the postmaster isn't listening at all on
the specified port, or else there's a firewall blocking connections.
Make sure that listen_addresses is set to * in postgresql.conf, and
check your system packet-filtering configuration.

            regards, tom lane