Re: Exception while accessing database
| От | John R Pierce |
|---|---|
| Тема | Re: Exception while accessing database |
| Дата | |
| Msg-id | 4C06CD8F.4030304@hogranch.com обсуждение исходный текст |
| Ответ на | Exception while accessing database (Manohar Bhattarai <manoharbhattarai@gmail.com>) |
| Список | 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 по дате отправления: