Re: Not able to connect to postgresql database

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Manohar Bhattarai" <manoharbhattarai(at)gmail(dot)com>, "dmp" <danap(at)ttc-cmc(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Not able to connect to postgresql database
Date: 2010-06-02 16:37:42
Message-ID: 4C0642860200002500031CC7@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Manohar Bhattarai <manoharbhattarai(at)gmail(dot)com> wrote:

> now the Driver is found. :)

Good news. :-)

> But now a new exception is :
> org.postgresql.util.PSQLException: FATAL: password authentication
> failed for user "postgres"

> But the password is the same that i use to login postgres user in
> the terminal.
> What could be the problem?

The password for the postgres *database* user is not necessarily the
same as for a postgres *OS* user. You need to find or reset the
database user password. If you need to reset it, you can do that by
modifying pg_hba.conf to allow trust or ident authentication (at
least temporarily) or by running the postmaster in single-user mode.

On the other hand, it is generally not a good idea to run the
application under the database superuser login; superuser logins
should be reserved for administrative purposes which require that
level of authority. I generally use a non-superuser user for the
database owner and less privileged users for running applications.

> Can you please give me the steps to set up new user and create new
> database after a fresh install of postgresql? I have doubts seeing
> different sites giving different methods.

There are a lot of ways to do that, and what you should do next
probably depends on what you've done so far. You're venturing into
territory which has nothing to do with JDBC -- you might want to
post this question on pgsql-admin or pgsql-general with a
description of what you've your OS, done so far, what you're trying
to do, and what problem you're hitting.

-Kevin

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2010-06-02 16:41:40 Re: Not able to connect to postgresql database
Previous Message Manohar Bhattarai 2010-06-02 16:18:00 Re: Not able to connect to postgresql database