Heim  >  Artikel  >  Datenbank  >  postgresql问题总结

postgresql问题总结

WBOY
WBOYOriginal
2016-06-07 15:22:341152Durchsuche

1.远程连接的时候FATAL:no pg_hba.conf entry for host ***************************** 这个问题是数据库初始化的data目录下的pg_hba.conf要加上host all all 0.0.0.0 0.0.0.0 md5,就是赋给所有IP访问权限 2.远程连接的时候FATAL:password authentication f

1.远程连接的时候FATAL:no pg_hba.conf entry for host *****************************

这个问题是数据库初始化的data目录下的pg_hba.conf要加上host all all 0.0.0.0 0.0.0.0 md5,就是赋给所有IP访问权限

2.远程连接的时候FATAL:password authentication failed for user “********”

还是更改上面的文件,还是上面那句话,md5改为trust即可。详细如下:

用jdbc连接Postgresql数据库时经常出现这个错误,然而用pgAdmin III是可以正确连接的,表明用户名和密码都是正确的。
这主要是由于用户密码认证方式引起的,Postgresql数据库安装好后默认采用md5密码加密认证方式。
解决方法:

打开Postgresql安装目录下的data文件夹,找到pg_hba.conf文件并打开。修改认证方式,将md5改为trust,然后保存。

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# IPv4 local connections:
host all all 127.0.0.1/32 trust

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn