Обсуждение: FATAL 1: Password authentication failed

Поиск
Список
Период
Сортировка

FATAL 1: Password authentication failed

От
"Godson Retna"
Дата:
Hi

I have tested some java code to connect to PostgreSQL database using 'trust'
relationship, which works.

quote:
----------------------------------------------------------------------------
----
[snathan@sip008 security]$ java Sample
DAtabase :PostGRESQL
Inside Main of Sample ####
Here
Database Driver rg.postgresql.Driver
Database Datasource :jdbcostgresql://192.168.66.3:5432/test
Database Login :u_test
Database Password :u_test
----------------------------------------------------------------------------
----



However, when I change the pg_hba.conf to have 'password' or 'md5' or
'crypt', the connection fails with the above error. But, I am able to
connect using 'psql' ...

quote:
----------------------------------------------------------------------------
----
[snathan@sip008 security]$ java Sample
DAtabase :PostGRESQL
Inside Main of Sample ####
Here
Database Driver rg.postgresql.Driver
Database Datasource :jdbcostgresql://192.168.66.3:5432/test
Database Login :u_test
Database Password :u_test
Something unusual has occured to cause the driver to fail. Please report
this exception: Exception: java.sql.SQLException: FATAL 1: Password
authentication failed for user "u_test"

Stack Trace:

java.sql.SQLException: FATAL 1: Password authentication failed for user
"u_test"

at org.postgresql.Connection.openConnection(Connection.java:178)
at org.postgresql.Driver.connect(Driver.java:149)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Sample.getConnectionToDatabase(Sample.java:58)
at Sample.main(Sample.java:22)
End of Stack Trace

at org.postgresql.Driver.connect(Driver.java:166)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Sample.getConnectionToDatabase(Sample.java:58)
at Sample.main(Sample.java:22)

----------------------------------------------------------------------------
----

Thanks for your valuable input.

Best Regards.

Godson R.
Chennai, India.




Re: FATAL 1: Password authentication failed

От
Bruce Momjian
Дата:
I recommend getting the newest jdbc driver from jdbc.postgresql.org.  It
should fix the problem.  What PostgreSQL server release are you using?

---------------------------------------------------------------------------

Godson Retna wrote:
> Hi
> 
> I have tested some java code to connect to PostgreSQL database using 'trust'
> relationship, which works.
> 
> quote:
> ----------------------------------------------------------------------------
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> ----------------------------------------------------------------------------
> ----
> 
> 
> 
> However, when I change the pg_hba.conf to have 'password' or 'md5' or
> 'crypt', the connection fails with the above error. But, I am able to
> connect using 'psql' ...
> 
> quote:
> ----------------------------------------------------------------------------
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> Something unusual has occured to cause the driver to fail. Please report
> this exception: Exception: java.sql.SQLException: FATAL 1: Password
> authentication failed for user "u_test"
> 
> Stack Trace:
> 
> java.sql.SQLException: FATAL 1: Password authentication failed for user
> "u_test"
> 
> at org.postgresql.Connection.openConnection(Connection.java:178)
> at org.postgresql.Driver.connect(Driver.java:149)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
> End of Stack Trace
> 
> at org.postgresql.Driver.connect(Driver.java:166)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
> 
> ----------------------------------------------------------------------------
> ----
> 
> Thanks for your valuable input.
> 
> Best Regards.
> 
> Godson R.
> Chennai, India.
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: FATAL 1: Password authentication failed

От
"Godson Retna"
Дата:
The PostgreSQL server releases are 7.2.1 and 7.2.3.

Did a download of the latest jdbc driver (pg73jdbc3.jar.zip) and got a
different error, which follows:


-----------------[quote]------------------

[snathan@sip008 security]$ java Sample
DAtabase :PostGRESQL
Inside Main of Sample ####
Here
Database Driver :org.postgresql.Driver
Database Datasource :jdbc:postgresql://192.168.66.185:5432/hris
Database Login :hris
Database Password :hris
A connection error has occurred: FATAL 1:  Password authentication failed
for user "hris"
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con
nection.java:202)at org.postgresql.Driver.connect(Driver.java:122)at
java.sql.DriverManager.getConnection(DriverManager.java:512)at
java.sql.DriverManager.getConnection(DriverManager.java:171)atSample.getConnectionToDatabase(Sample.java:58)at
Sample.main(Sample.java:22)
[snathan@sip008 security]$

----------------[end quote]------------------


-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Wednesday, December 11, 2002 12:41 AM
To: Godson Retna
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] FATAL 1: Password authentication failed



I recommend getting the newest jdbc driver from jdbc.postgresql.org.  It
should fix the problem.  What PostgreSQL server release are you using?

---------------------------------------------------------------------------

Godson Retna wrote:
> Hi
>
> I have tested some java code to connect to PostgreSQL database using
'trust'
> relationship, which works.
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> --------------------------------------------------------------------------
--
> ----
>
>
>
> However, when I change the pg_hba.conf to have 'password' or 'md5' or
> 'crypt', the connection fails with the above error. But, I am able to
> connect using 'psql' ...
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> Something unusual has occured to cause the driver to fail. Please report
> this exception: Exception: java.sql.SQLException: FATAL 1: Password
> authentication failed for user "u_test"
>
> Stack Trace:
>
> java.sql.SQLException: FATAL 1: Password authentication failed for user
> "u_test"
>
> at org.postgresql.Connection.openConnection(Connection.java:178)
> at org.postgresql.Driver.connect(Driver.java:149)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
> End of Stack Trace
>
> at org.postgresql.Driver.connect(Driver.java:166)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
>
> --------------------------------------------------------------------------
--
> ----
>
> Thanks for your valuable input.
>
> Best Regards.
>
> Godson R.
> Chennai, India.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

-- Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 



Re: FATAL 1: Password authentication failed

От
"Godson Retna"
Дата:
I'm enclosing the files used for this purpose:

Thanks.




-----Original Message-----
From: Godson Retna [mailto:godsonr@siptech.co.in]
Sent: Wednesday, December 11, 2002 12:10 PM
To: Bruce Momjian
Cc: pgsql-interfaces@postgresql.org
Subject: RE: [INTERFACES] FATAL 1: Password authentication failed


The PostgreSQL server releases are 7.2.1 and 7.2.3.

Did a download of the latest jdbc driver (pg73jdbc3.jar.zip) and got a
different error, which follows:


-----------------[quote]------------------

[snathan@sip008 security]$ java Sample
DAtabase :PostGRESQL
Inside Main of Sample ####
Here
Database Driver :org.postgresql.Driver
Database Datasource :jdbc:postgresql://192.168.66.185:5432/hris
Database Login :hris
Database Password :hris
A connection error has occurred: FATAL 1:  Password authentication failed
for user "hris"

    at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con
nection.java:202)
    at org.postgresql.Driver.connect(Driver.java:122)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at Sample.getConnectionToDatabase(Sample.java:58)
    at Sample.main(Sample.java:22)
[snathan@sip008 security]$

----------------[end quote]------------------


-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Wednesday, December 11, 2002 12:41 AM
To: Godson Retna
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] FATAL 1: Password authentication failed



I recommend getting the newest jdbc driver from jdbc.postgresql.org.  It
should fix the problem.  What PostgreSQL server release are you using?

---------------------------------------------------------------------------

Godson Retna wrote:
> Hi
>
> I have tested some java code to connect to PostgreSQL database using
'trust'
> relationship, which works.
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> --------------------------------------------------------------------------
--
> ----
>
>
>
> However, when I change the pg_hba.conf to have 'password' or 'md5' or
> 'crypt', the connection fails with the above error. But, I am able to
> connect using 'psql' ...
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> Something unusual has occured to cause the driver to fail. Please report
> this exception: Exception: java.sql.SQLException: FATAL 1: Password
> authentication failed for user "u_test"
>
> Stack Trace:
>
> java.sql.SQLException: FATAL 1: Password authentication failed for user
> "u_test"
>
> at org.postgresql.Connection.openConnection(Connection.java:178)
> at org.postgresql.Driver.connect(Driver.java:149)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
> End of Stack Trace
>
> at org.postgresql.Driver.connect(Driver.java:166)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
>
> --------------------------------------------------------------------------
--
> ----
>
> Thanks for your valuable input.
>
> Best Regards.
>
> Godson R.
> Chennai, India.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Вложения

Re: FATAL 1: Password authentication failed

От
"Godson Retna"
Дата:
The issue was finally solved!  The culprit was a space in the properties
file after the password entry (i.e., 'test '), because of this
authentication failed.  Thanks very much for the support.

-----Original Message-----
From: Godson Retna [mailto:godsonr@siptech.co.in]
Sent: Wednesday, December 11, 2002 6:56 PM
To: pgsql-interfaces@postgresql.org
Cc: pgman@candle.pha.pa.us
Subject: RE: [INTERFACES] FATAL 1: Password authentication failed


I'm enclosing the files used for this purpose:

Thanks.




-----Original Message-----
From: Godson Retna [mailto:godsonr@siptech.co.in]
Sent: Wednesday, December 11, 2002 12:10 PM
To: Bruce Momjian
Cc: pgsql-interfaces@postgresql.org
Subject: RE: [INTERFACES] FATAL 1: Password authentication failed


The PostgreSQL server releases are 7.2.1 and 7.2.3.

Did a download of the latest jdbc driver (pg73jdbc3.jar.zip) and got a
different error, which follows:


-----------------[quote]------------------

[snathan@sip008 security]$ java Sample
DAtabase :PostGRESQL
Inside Main of Sample ####
Here
Database Driver :org.postgresql.Driver
Database Datasource :jdbc:postgresql://192.168.66.185:5432/hris
Database Login :hris
Database Password :hris
A connection error has occurred: FATAL 1:  Password authentication failed
for user "hris"
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con
nection.java:202)at org.postgresql.Driver.connect(Driver.java:122)at
java.sql.DriverManager.getConnection(DriverManager.java:512)at
java.sql.DriverManager.getConnection(DriverManager.java:171)atSample.getConnectionToDatabase(Sample.java:58)at
Sample.main(Sample.java:22)
[snathan@sip008 security]$

----------------[end quote]------------------


-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Wednesday, December 11, 2002 12:41 AM
To: Godson Retna
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] FATAL 1: Password authentication failed



I recommend getting the newest jdbc driver from jdbc.postgresql.org.  It
should fix the problem.  What PostgreSQL server release are you using?

---------------------------------------------------------------------------

Godson Retna wrote:
> Hi
>
> I have tested some java code to connect to PostgreSQL database using
'trust'
> relationship, which works.
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> --------------------------------------------------------------------------
--
> ----
>
>
>
> However, when I change the pg_hba.conf to have 'password' or 'md5' or
> 'crypt', the connection fails with the above error. But, I am able to
> connect using 'psql' ...
>
> quote:
> --------------------------------------------------------------------------
--
> ----
> [snathan@sip008 security]$ java Sample
> DAtabase :PostGRESQL
> Inside Main of Sample ####
> Here
> Database Driver rg.postgresql.Driver
> Database Datasource :jdbcostgresql://192.168.66.3:5432/test
> Database Login :u_test
> Database Password :u_test
> Something unusual has occured to cause the driver to fail. Please report
> this exception: Exception: java.sql.SQLException: FATAL 1: Password
> authentication failed for user "u_test"
>
> Stack Trace:
>
> java.sql.SQLException: FATAL 1: Password authentication failed for user
> "u_test"
>
> at org.postgresql.Connection.openConnection(Connection.java:178)
> at org.postgresql.Driver.connect(Driver.java:149)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
> End of Stack Trace
>
> at org.postgresql.Driver.connect(Driver.java:166)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Sample.getConnectionToDatabase(Sample.java:58)
> at Sample.main(Sample.java:22)
>
> --------------------------------------------------------------------------
--
> ----
>
> Thanks for your valuable input.
>
> Best Regards.
>
> Godson R.
> Chennai, India.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

-- Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073