: FATAL: password authentication failed for user "postgres"
用jdbc连接Postgresql数据库时经常出现这个错误,然而用pgAdmin III是可以正确连接的,表明用户名和密码都是正确的。
这主要是由于用户密码认证方式引起的,Postgresql数据库安装好后默认采用md5密码加密认证方式。
解决方法:
1. 打开Postgresql安装目录下的data文件夹,找到pg_hba.conf文件并打开。
2. 修改认证方式,将md5改为trust,然后保存。
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 trust
相关文章
- fatal: Authentication failed could not read from remote repository
- Git报错remote: Verify fatal: Authentication failed for ***
- Git报错fatal:Authentication failed for‘https://git……解决方法
- : FATAL: password authentication failed for us
- Git进行clone的时候,报错:remote: HTTP Basic: Access denied fatal: Authentication failed for ...
- HTTP Basic: Access denied fatal: Authentication failed...
- 关于sourceTree一直报fatal:Authentication failed for 的错误解决方案
- GIT clone 时报 fatal: Authentication failed的问题
- PostgreSQL安装遇到的坑:Problem running post-install step/password authentication failed for user postgres
- Git:fatal: Authentication failed