Re: Exception while accessing database

From: John R Pierce <pierce(at)hogranch(dot)com>
To: undisclosed-recipients:;
Subject: Re: Exception while accessing database
Date: 2010-06-02 21:30:55
Message-ID: 4C06CD8F.4030304@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Manohar Bhattarai wrote:
> Hi,
> This problem was initially asked to pgsql-jdbc(at)postgresql(dot)org
> <mailto:pgsql-jdbc(at)postgresql(dot)org> and I was suggested to ask this
> problem here.
> So my initial problem was that i was not able to set the Driver for
> postgresql. I solved that problem with the help there.
>
> But I have a new exception and it is :
> org.postgresql.util.PSQLException: FATAL: password authentication
> failed for user "postgres"
>
> I am giving the line for connection that i am using :
> connection = DriverManager.getConnection(connectionURL, "postgres",
> "mypasswordhere");
>
> But the password is the same that i use to login postgres user in the
> terminal.
> What could be the problem?
>

from the psql command line tool, ALTER USER username WITH PASSWORD
'mypasswordhere';

However, your app probably shouldn't be using the postgres account,
instead it should be using a different account (and database)

CREATE USER someuser WITH PASSWORD 'somepassword';
CREATE DATABASE somedatabase WITH OWNER someuser;

then use that user and database instead.
.....

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Lacey Powers 2010-06-02 22:58:31 Re: pitrtools package wrong dependency (binary packages)
Previous Message Kevin Grittner 2010-06-02 20:44:30 Re: Exception while accessing database

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-06-02 21:37:42 [Fwd: Put me on your white list]
Previous Message Tim Landscheidt 2010-06-02 21:28:27 Re: Is it possible to make the order of output the same as the order of input parameters?