Обсуждение: troubleshooting suggestions requested

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

troubleshooting suggestions requested

От
"Richard Romanowski"
Дата:
Greetings to all.  I wonder if I might trouble you with a beginner's question.

I have a postgres installation that appears to be working correctly when I used psql to connect to it from the postgres
account. However, when I try to connect as postgres from other accounts, I can't connect.  I think the password has
beenset correctly with ALTER USER from inside psql.  

I get the error:
[rick@localhost javatest]$ e2:Connection refused. Check that the hostname and port are correct and that the postmaster
isaccepting TCP/IP connections. 
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP
connections.
        at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:167)
        at org.postgresql.Driver.connect(Driver.java:122)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at j5.<init>(j5.java:17)
        at j5.main(j5.java:29)


and the relevant chunk of my code is:
        final static private String _url = "jdbc:postgresql://localhost:5432/wombat1test";
        j5() {
                try {
                Class.forName(_driver);
                c = DriverManager.getConnection(_url, "postgres", "wombatpassport");
                }
                catch (java.sql.SQLException e2) {
                        System.out.println("e2:"+e2.toString());
                        e2.printStackTrace();
                }
====
Clearly, there are quite a few things that could be wrong.  I've been reading the documentation and archive, but my
troubleshootingingenuity is running low.  If  
anyone has any suggestions, I would be very grateful.

Thanks
Rick

Re: troubleshooting suggestions requested

От
"Dirk Bromberg"
Дата:
Watch at the /usr/local/pgsql/data/pg_hba.conf

insert the lines like that at the end: (read the text in the file
before)

local   all         all
trust
host    all         all         0.0.0.0         0.0.0.0
md5


Dirk Bromberg




>-----Ursprüngliche Nachricht-----
>Von: pgsql-jdbc-owner@postgresql.org
>[mailto:pgsql-jdbc-owner@postgresql.org] Im Auftrag von
>Richard Romanowski
>Gesendet: Mittwoch, 5. März 2003 17:38
>An: pgsql-jdbc@postgresql.org
>Betreff: [JDBC] troubleshooting suggestions requested
>
>
>Greetings to all.  I wonder if I might trouble you with a
>beginner's question.
>
>I have a postgres installation that appears to be working
>correctly when I used psql to connect to it from the postgres
>account.  However, when I try to connect as postgres from
>other accounts, I can't connect.  I think the password has
>been set correctly with ALTER USER from inside psql.
>
>I get the error:
>[rick@localhost javatest]$ e2:Connection refused. Check that
>the hostname and port are correct and that the postmaster is
>accepting TCP/IP connections. Connection refused. Check that
>the hostname and port are correct and that the postmaster is
>accepting TCP/IP connections.
>        at
>org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(Abs
>tractJdbc1Connection.java:167)
>        at org.postgresql.Driver.connect(Driver.java:122)
>        at java.sql.DriverManager.getConnection(DriverManager.java:512)
>        at java.sql.DriverManager.getConnection(DriverManager.java:171)
>        at j5.<init>(j5.java:17)
>        at j5.main(j5.java:29)
>
>
>and the relevant chunk of my code is:
>        final static private String _url =
>"jdbc:postgresql://localhost:5432/wombat1test";
>        j5() {
>                try {
>                Class.forName(_driver);
>                c = DriverManager.getConnection(_url,
>"postgres", "wombatpassport");
>                }
>                catch (java.sql.SQLException e2) {
>                        System.out.println("e2:"+e2.toString());
>                        e2.printStackTrace();
>                }
>====
>Clearly, there are quite a few things that could be wrong.
>I've been reading the documentation and archive, but my
>troubleshooting ingenuity is running low.  If
>anyone has any suggestions, I would be very grateful.
>
>Thanks
>Rick
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org
>
>


Re: troubleshooting suggestions requested

От
Rafal Kedziorski
Дата:
hi,

take a look in to the file pg_hba.conf and be sure, that You are enabling
TCP/IP connections.


Rafal

At 11:38 05.03.2003 -0500, Richard Romanowski wrote:
>Greetings to all.  I wonder if I might trouble you with a beginner's question.

>I have a postgres installation that appears to be working correctly when I
>used psql to connect to it from the postgres account.  However, when I try
>to connect as postgres from other accounts, I can't connect.  I think the
>password has been set correctly with ALTER USER from inside psql.
>
>I get the error:
>[rick@localhost javatest]$ e2:Connection refused. Check that the hostname
>and port are correct and that the postmaster is accepting TCP/IP connections.
>Connection refused. Check that the hostname and port are correct and that
>the postmaster is accepting TCP/IP connections.
>         at
> org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:167)
>         at org.postgresql.Driver.connect(Driver.java:122)
>         at java.sql.DriverManager.getConnection(DriverManager.java:512)
>         at java.sql.DriverManager.getConnection(DriverManager.java:171)
>         at j5.<init>(j5.java:17)
>         at j5.main(j5.java:29)
>
>
>and the relevant chunk of my code is:
>         final static private String _url =
> "jdbc:postgresql://localhost:5432/wombat1test";
>         j5() {
>                 try {
>                 Class.forName(_driver);
>                 c = DriverManager.getConnection(_url, "postgres",
> "wombatpassport");
>                 }
>                 catch (java.sql.SQLException e2) {
>                         System.out.println("e2:"+e2.toString());
>                         e2.printStackTrace();
>                 }
>====
>Clearly, there are quite a few things that could be wrong.  I've been
>reading the documentation and archive, but my troubleshooting ingenuity is
>running low.  If
>anyone has any suggestions, I would be very grateful.


Re: troubleshooting suggestions requested

От
Dave Cramer
Дата:
You also have to enable them in postgresql.conf or on the command line

Dave
On Wed, 2003-03-05 at 11:49, Rafal Kedziorski wrote:
> hi,
>
> take a look in to the file pg_hba.conf and be sure, that You are enabling
> TCP/IP connections.
>
>
> Rafal
>
> At 11:38 05.03.2003 -0500, Richard Romanowski wrote:
> >Greetings to all.  I wonder if I might trouble you with a beginner's question.
>
> >I have a postgres installation that appears to be working correctly when I
> >used psql to connect to it from the postgres account.  However, when I try
> >to connect as postgres from other accounts, I can't connect.  I think the
> >password has been set correctly with ALTER USER from inside psql.
> >
> >I get the error:
> >[rick@localhost javatest]$ e2:Connection refused. Check that the hostname
> >and port are correct and that the postmaster is accepting TCP/IP connections.
> >Connection refused. Check that the hostname and port are correct and that
> >the postmaster is accepting TCP/IP connections.
> >         at
> > org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:167)
> >         at org.postgresql.Driver.connect(Driver.java:122)
> >         at java.sql.DriverManager.getConnection(DriverManager.java:512)
> >         at java.sql.DriverManager.getConnection(DriverManager.java:171)
> >         at j5.<init>(j5.java:17)
> >         at j5.main(j5.java:29)
> >
> >
> >and the relevant chunk of my code is:
> >         final static private String _url =
> > "jdbc:postgresql://localhost:5432/wombat1test";
> >         j5() {
> >                 try {
> >                 Class.forName(_driver);
> >                 c = DriverManager.getConnection(_url, "postgres",
> > "wombatpassport");
> >                 }
> >                 catch (java.sql.SQLException e2) {
> >                         System.out.println("e2:"+e2.toString());
> >                         e2.printStackTrace();
> >                 }
> >====
> >Clearly, there are quite a few things that could be wrong.  I've been
> >reading the documentation and archive, but my troubleshooting ingenuity is
> >running low.  If
> >anyone has any suggestions, I would be very grateful.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Dave Cramer <Dave@micro-automation.net>