Обсуждение: Unable to connect to a server

Поиск
Список
Период
Сортировка

Unable to connect to a server

От
Steve Henry
Дата:
I'm a newbie, using the Mac platform.

I've installed PostgreSQL on a server and can run PostgreSQL based
application from that server with no problem.  But when I try to
access the DB on a different computer, pointing to the server for the
log in, I get this error:

A connection to the specified xTuple ERP Server cannot be made. This
may be due to an incorrect Username and/or Password or the server in
question cannot support any more connections.
Please verify your Username and Password and try again or wait until
the specified xTuple ERP Server is less busy.
System Error
QPSQL: Unable to connect

 From doing some reading, I think the solution is to change the value
of  listen_addresses to '*'

But I don't know where to do that.  I'm using pgAdmin3.  Can it be
done there?  Or do I need to use Terminal?

Any help would be appreciated...

Steve
-----------------------------------------
Steve Henry
San Diego Mac IT
http://www.sdmacit.com
760.546.8863 Cell


Re: Unable to connect to a server

От
"A. Kretschmer"
Дата:
am  Tue, dem 11.11.2008, um 17:37:35 -0800 mailte Steve Henry folgendes:
> I'm a newbie, using the Mac platform.
>
> I've installed PostgreSQL on a server and can run PostgreSQL based
> application from that server with no problem.  But when I try to
> access the DB on a different computer, pointing to the server for the
> log in, I get this error:
>
> A connection to the specified xTuple ERP Server cannot be made. This
> may be due to an incorrect Username and/or Password or the server in
> question cannot support any more connections.
> Please verify your Username and Password and try again or wait until
> the specified xTuple ERP Server is less busy.
> System Error
> QPSQL: Unable to connect
>
> From doing some reading, I think the solution is to change the value
> of  listen_addresses to '*'

Not only that, you should also edit your pg_hba.conf to allow remote
access.


>
> But I don't know where to do that.  I'm using pgAdmin3.  Can it be
> done there?  Or do I need to use Terminal?

I'm not familiar with PGAdmin...


HTH, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: Unable to connect to a server

От
Bob McConnell
Дата:
A. Kretschmer wrote:
> am  Tue, dem 11.11.2008, um 17:37:35 -0800 mailte Steve Henry folgendes:
>> I'm a newbie, using the Mac platform.
>>
>> I've installed PostgreSQL on a server and can run PostgreSQL based
>> application from that server with no problem.  But when I try to
>> access the DB on a different computer, pointing to the server for the
>> log in, I get this error:
>>
>> A connection to the specified xTuple ERP Server cannot be made. This
>> may be due to an incorrect Username and/or Password or the server in
>> question cannot support any more connections.
>> Please verify your Username and Password and try again or wait until
>> the specified xTuple ERP Server is less busy.
>> System Error
>> QPSQL: Unable to connect
>>
>> From doing some reading, I think the solution is to change the value
>> of  listen_addresses to '*'
>
> Not only that, you should also edit your pg_hba.conf to allow remote
> access.
>
>
>> But I don't know where to do that.  I'm using pgAdmin3.  Can it be
>> done there?  Or do I need to use Terminal?
>
> I'm not familiar with PGAdmin...

pgAdmin will not edit the correct files for you. You need to open them
on that server with a text editor to modify those settings. Then you
need to restart postgres, also on that server. You don't say what OS
that server is running, so I can't help any further. However, I suggest
that instead of setting the address to '*', you use the subnet and mask
for your local network. That way if someone gets access to it from the
Internet, they can't connect to your database server. In my case that
would be:

postgres.conf
-------------
listen_address = 'localhost,172.16.10.13'

pg_hba.conf
-----------
# IP4 local connections:
host    all    all    172.16.10.0/24    trust

You may also want to set a different security level rather than trust. I
am the only user on my network, so 'trust' works for me. That's not what
we use on the servers at work.

Bob McConnell
N2SPP


Re: Unable to connect to a server

От
Tom Lane
Дата:
"A. Kretschmer" <andreas.kretschmer@schollglas.com> writes:
> am  Tue, dem 11.11.2008, um 17:37:35 -0800 mailte Steve Henry folgendes:
>> I'm a newbie, using the Mac platform.
>> ...
>> From doing some reading, I think the solution is to change the value
>> of  listen_addresses to '*'

> Not only that, you should also edit your pg_hba.conf to allow remote
> access.

Another likely gotcha is the platform's firewall -- you may have to poke
a hole for port 5432 using the security tab in system preferences.

>> But I don't know where to do that.  I'm using pgAdmin3.  Can it be
>> done there?  Or do I need to use Terminal?

Just open up the files with TextEdit or your favorite other plain-text
editor.  They're in whatever PGDATA directory you pointed initdb at.
You'll need to restart the postmaster after changing listen_addresses.

            regards, tom lane

Re: Unable to connect to a server

От
"Obe, Regina"
Дата:
> pgAdmin will not edit the correct files for you. You need to open them

> on that server with a text editor to modify those settings.

Slight correction to Bob's note - not that it helps in this case but I
thought I would set the record straight.

You CAN edit the files from PgAdmin even for a remote server as long as
the adminpack.sql (located in contrib folder) (I think that is the one)
is installed on the postgresql server you are connecting to.  It is
located under Tools->Server Configuration of PgAdmin III.

I do it all the time for quick edits.  Though in general especially for
more involved edits I find it easier to edit the pg_hba.conf and
postgresql.conf files directly.

Hope that helps,
Regina
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.