pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
Subject: Re: Exception while accessing database
Date: Wed, 02 Jun 2010 14:30:55 -0700
Message-ID: <4C06CD8F.4030304@hogranch.com> (raw)
In-Reply-To: <AANLkTilPLQavzfAVQvaWJOTlpG5SztbzXKYYwmCmHq_s@mail.gmail.com>
References: <AANLkTilPLQavzfAVQvaWJOTlpG5SztbzXKYYwmCmHq_s@mail.gmail.com>

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.
.....





view thread (4+ messages)  latest in thread

Message-ID: <4C06CD8F.4030304@hogranch.com>
Permalink:  ../4C06CD8F.4030304@hogranch.com/
Also on:    postgresql.org/message-id/4C06CD8F.4030304@hogranch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pierce@hogranch.com
  Subject: Re: Exception while accessing database
  In-Reply-To: <4C06CD8F.4030304@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox