Re: Exception while accessing database - Mailing list pgsql-general

From John R Pierce
Subject Re: Exception while accessing database
Date
Msg-id 4C06CD8F.4030304@hogranch.com
Whole thread Raw
In response to Exception while accessing database  (Manohar Bhattarai <manoharbhattarai@gmail.com>)
List pgsql-general
Manohar Bhattarai wrote:
> Hi,
> This problem was initially asked to pgsql-jdbc@postgresql.org
> <mailto:pgsql-jdbc@postgresql.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.
.....



pgsql-general by date:

Previous
From: Tim Landscheidt
Date:
Subject: Re: Is it possible to make the order of output the same as the order of input parameters?
Next
From: John R Pierce
Date:
Subject: [Fwd: Put me on your white list]