Chinaunix首页 | 论坛 | 博客

e

  • 博客访问: 109293
  • 博文数量: 15
  • 博客积分: 2041
  • 博客等级: 大尉
  • 技术积分: 197
  • 用 户 组: 管理员
  • 注册时间: 2012-02-12 10:26
个人简介

木有介绍 爱咋咋地

文章分类

全部博文(15)

分类:

2012-11-12 14:41:01

1.错误信息

$ sudo java -cp .:lib/postgresql-9.1-903.jdbc4.jar zetcode/Version
Nov 12, 2012 12:27:12 AM zetcode.Version main
SEVERE: FATAL: password authentication failed for user "user12"
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "user12"
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:106)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:123)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:28)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.(AbstractJdbc3gConnection.java:20)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.(Jdbc4Connection.java:22)
    at org.postgresql.Driver.makeConnection(Driver.java:391)
    at org.postgresql.Driver.connect(Driver.java:265)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:221)
    at zetcode.Version.main(Version.java:25)


2.解决方法

# sudo -u postgres psql       
postgres=# ALTER USER user12 WITH PASSWORD 'user12';
postgres参考:http://blog.chinaunix.net/uid-25885064-id-3404550.html


3.结果

$ sudo java -cp .:lib/postgresql-9.1-903.jdbc4.jar zetcode/Version
[sudo] password for txgcwm:
PostgreSQL 9.1.6 on i686-pc-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2, 32-bit
阅读(2637) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~