473,765 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

psql won't connect, though other clients are OK

2 New Member
Hello -
I'm running PG 8.1 on Windows XP.
I've installed the server to run as a service.

The psql command fails to connect to the server, although I can connect with other clients.

When I enter psql -d mydb -h localhost -U admin
I get the following response:
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?


However, with the following steps I can prove that the server is indeed running on localhost and listening on 5432.

First, I run pgAdmin3 and connect to the server. The properties panel shows me that I'm connected to the server via localhost port 5432.
Next, with pgAdmin3 running, I do a netstat and get the following result:

TCP jma:1500 localhost:5432 ESTABLISHED
TCP jma:1502 localhost:5432 ESTABLISHED
TCP jma:5432 localhost:1500 ESTABLISHED
TCP jma:5432 localhost:1502 ESTABLISHED

But if I now run psql, I get the same error message as before.

My postgresql.conf file has the following line:
listen_addresse s = 'localhost'
I also tried changed 'localhost' to '*', but the result was the same.

If I leave off the -h option on the psql command, the message is a little different. It says (in part):
... Is the server running on host "???" ...

I've searched the threads in this forum for psql problems and found a few. But not exactly this one.

Can anyone tell me why psql won't connect?
May 16 '07 #1
3 4000
michaelb
534 Recognized Expert Contributor
We may need to look at postgresql.conf and pg_hba.conf, but before we get to it, are you running a firewall on this computer?
If yes, could you try to disable it for a minute and run psql again?
May 17 '07 #2
oksofar
2 New Member
Thank you. It was my Zone Alarm firewall. I turned it off, and it worked.

I originally thought that the firewall was not the problem, because it was letting the other clients connect.

Strange thing though --- when I turned ZA back on, it let psql run. I found that it had created a rule saying psql was OK. bizarre.
May 22 '07 #3
michaelb
534 Recognized Expert Contributor
Yes, ZoneAlarm can be tricky. If I remember correctly there could be different ways to allow your programs to work, you can open the specific port#, or you can designate a certain app as trusted... Anyway, the good thing is you got it working!
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5705
by: Phil Campaigne | last post by:
Hi All, Took a break from developing on pgsql 7.3 to set up network printing where I added another host(localhost 193.168.1.2) in red hat network settings. Later, I could start postmaster but when I started psql I got the following error when I issue this command: psql -h localhost -U postgres nba -bash-2.05b$ psql -h localhost -U postgres nba psql: error while loading shared libraries: libpq.so.3: cannot open
0
4546
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager Express Edition v1.3.2 Win, IBM Tivoli System Automation v1.2.0 Linux, IBM Tivoli Workload Scheduler Virtualized Data Centers v8.2 , other IBM Tivoli CDs, WEBSPHERE EVERYPLACE MOBILE PORTAL v5.0 - ALTIUM , other IBM WebSphere Business CDs...
4
5221
by: Phil Campaigne | last post by:
Hi All, I just installed postgresql 7.3.4 as an upgrade to 7.3.2 and all went well untill I tried to log into a database that I successfully created. Here are the steps in question: bash-2.05b$ psql -h localhost -U postgres hardwoodthunder Welcome to psql 7.3.2, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands
4
2154
by: Brendan Jurd | last post by:
Hello all, I just wanted to pass on some information about compatibility between the psql client and the postgres server. On a particular network, my workstation and the server are both debian boxes, but the workstation is on a more frequent upgrade schedule. The server is still running postgres 7.3.4, but my workstation has been upgraded with the latest (7.4.1) postgres client tools.
7
1806
by: Mike McGavin | last post by:
Hi everyone. I'm searching for a quick and dirty way to have psql record the SQL statements that I enter, especially those related to the database structure. My main motivation is to help keep what will probably be a production server up-to-date with my development server. I've thought a little about replication, but the current options for that seem like overkill for the relatively small database that I have. I'm particularly
33
14030
by: John Sidney-Woollett | last post by:
With the advent of postgres v8, would it be possible to change the default behaviour of psql from AUTOCOMMIT=ON to AUTOCOMMIT=OFF ? Although this might break backward compatibility, it might be acceptable on the basis that v8 is such a major release. Also adding a new command line parameter to control the AUTOCOMMIT setting for those users that will experience broken scripts executed (especially using the -c command) might help ease...
2
1649
by: Patrick Hatcher | last post by:
Just installed and started Pg8.0 beta 2 When I tried to connect via psql, I received an error message: $ psql -Upostgres template1 psql: relocation error: psql: undefined symbol: PQsetErrorVerbosity Can someone give me a clue what to do next? Thank you -Patrick
4
3516
by: Jim Seymour | last post by:
Hi, Environment: SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine Postgresql-7.4.6 Build config: --with-java --enable-thread-safety gcc version 3.3.1 less-381 readline-4.3
1
7556
by: mrflibble | last post by:
I've got a postgres db running on a windows mc. I've set it up to accept remote connections. Can I use psql from another machine (*nix) to connect to it? I've tried this: psql MYDB -U postgres -h 192.168.1.20 but I get the error missing or erroneous pg_hba.conf file which I don't understand. The pg_hba.conf file is a configuration file residing on the host, isn't it? Why is the client asking for it?
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.