pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedException while accessing database
4+ messages / 3 participants
[nested] [flat]
* Exception while accessing database
@ 2010-06-02 18:23 Manohar Bhattarai <manoharbhattarai@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Manohar Bhattarai @ 2010-06-02 18:23 UTC (permalink / raw)
To: pgsql-admin; pgsql-general@postgresql.org
Hi,
This problem was initially asked to 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?
I am using (Linux)Ubuntu 8.04 as OS, Postgresql is 8.3, java is jdk1.6,
using Eclipse as IDE, and trying to make a project in jsp.
My problem is that I had installed postgresql8.3 successfully. and after
some search on the google gave me some configuration details which i
followed. But I am not able to understand how to start creating a new user
and a new database after a fresh installation of postgres.
Can you provide me with come details to how to create a new user and new
database after a new installation of postgres?
If you need any more details i will provide them. Please help me solve this
problem.
--
Regards,
Manohar Bhattarai (मनोहर भट्टराई)
Blogs:
http://manoharbhattarai.wordpress.com/
http://manoharbhattarai.posterous.com/
http://manoharbhattarai.blogspot.com/
Microblogs:
Twitter :- http://twitter.com/manoharmailme
Identi.ca :- http://identi.ca/manoharbhattarai
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Exception while accessing database
@ 2010-06-02 20:44 Kevin Grittner <Kevin.Grittner@wicourts.gov>
parent: Manohar Bhattarai <manoharbhattarai@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Kevin Grittner @ 2010-06-02 20:44 UTC (permalink / raw)
To: Manohar Bhattarai <manoharbhattarai@gmail.com>; pgsql-admin; pgsql-general@postgresql.org
Manohar Bhattarai <manoharbhattarai@gmail.com> wrote:
> 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?
When you say "postgres user in the terminal", do you mean logging in
to the operating system? If so, that has nothing to do with the
database login unless you choose to make it so by having an "ident"
entry in the pg_hba.conf file.
http://www.postgresql.org/docs/8.3/interactive/client-authentication.html
> I am not able to understand how to start creating a new user
> and a new database after a fresh installation of postgres.
Once you get logged in with the postgres user, that would be the
CREATE DATABASE and CREATE USER statements:
http://www.postgresql.org/docs/8.3/interactive/sql-createdatabase.html
http://www.postgresql.org/docs/8.3/interactive/sql-createuser.html
-Kevin
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Exception while accessing database
@ 2010-06-02 21:30 John R Pierce <pierce@hogranch.com>
parent: Manohar Bhattarai <manoharbhattarai@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: John R Pierce @ 2010-06-02 21:30 UTC (permalink / raw)
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.
.....
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Exception while accessing database
@ 2010-06-05 11:34 Manohar Bhattarai <manoharbhattarai@gmail.com>
parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 0 replies; 4+ messages in thread
From: Manohar Bhattarai @ 2010-06-05 11:34 UTC (permalink / raw)
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-admin; pgsql-general@postgresql.org
On Thu, Jun 3, 2010 at 2:14 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov>wrote:
> Manohar Bhattarai <manoharbhattarai@gmail.com> wrote:
>
> > 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?
>
> When you say "postgres user in the terminal", do you mean logging in
> to the operating system? If so, that has nothing to do with the
> database login unless you choose to make it so by having an "ident"
> entry in the pg_hba.conf file.
>
> http://www.postgresql.org/docs/8.3/interactive/client-authentication.html
>
> > I am not able to understand how to start creating a new user
> > and a new database after a fresh installation of postgres.
>
> Once you get logged in with the postgres user, that would be the
> CREATE DATABASE and CREATE USER statements:
>
> http://www.postgresql.org/docs/8.3/interactive/sql-createdatabase.html
>
> http://www.postgresql.org/docs/8.3/interactive/sql-createuser.html
>
> -Kevin
>
Thank you. The problem is solved. :) Thanks for your help.
--
Regards,
Manohar Bhattarai (मनोहर भट्टराई)
Blogs:
http://manoharbhattarai.wordpress.com/
http://manoharbhattarai.posterous.com/
http://manoharbhattarai.blogspot.com/
Microblogs:
Twitter :- http://twitter.com/manoharmailme
Identi.ca :- http://identi.ca/manoharbhattarai
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2010-06-05 11:34 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-02 18:23 Exception while accessing database Manohar Bhattarai <manoharbhattarai@gmail.com>
2010-06-02 20:44 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2010-06-05 11:34 ` Manohar Bhattarai <manoharbhattarai@gmail.com>
2010-06-02 21:30 ` John R Pierce <pierce@hogranch.com>
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