简体   繁体   English

错误连接到PostgreSQL

[英]error connection to postgresql

I am trying to connect to PostgreSQL with ArcCatalog. 我正在尝试使用ArcCatalog连接到PostgreSQL。 But I do not think that does matter. 但我认为这并不重要。 I can't connect even with pgAdmin. 即使使用pgAdmin也无法连接。 The connection work well on localhost, the problem is only with connection from remote PC. 该连接在localhost上运行良好,问题仅在于来自远程PC的连接。

Every time I am getting error: 每次遇到错误时:

Failed to connect to the specified server.
Underlying DBMS error [Fatal: missing or erroneous pg_hba.conf file HINT: See server log for details. 
SQL state:]

I can't understand the reason of this error. 我无法理解此错误的原因。 I looked at ESRI site and have found there tool named "PostgreSQL DBMS for Windows", but it's available only for arcgis 10.1 and Win x64. 我查看了ESRI网站,发现那里有名为“ Windows的PostgreSQL DBMS”的工具,但该工具仅适用于arcgis 10.1和Win x64。

I know that by default PostgreSQL disallow remote connection, so I put to pg_hba.conf next text: 我知道默认情况下PostgreSQL不允许远程连接,所以我在pg_hba.conf下输入了以下文本:

host    all         all         127.0.0.1/32          md5

host    all         all         169.254.231.203          trust

host    all         all     0.0.0.0/0       trust

Please check 169.254.231.203 is valid ip address. 请检查169.254.231.203是有效的IP地址。 You should configure pg_hba.conf for remote accessing your database. 您应该配置pg_hba.conf来远程访问数据库。 I hope these link will help you. 希望这些链接能对您有所帮助。

  1. http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html
  2. http://www.linuxtopia.org/online_books/database_guides/Practical_PostgreSQL_database/c15679_002.htm http://www.linuxtopia.org/online_books/database_guides/Practical_PostgreSQL_database/c15679_002.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM