postgresql - 无法使用本地 IP 地址作为我的主机连接到 postgres 服务器(例如 : 192. 168.x.x)

标签 postgresql pgadmin

enter image description here 到目前为止,我正在使用 postgres 9.6,使用 localhost, 现在我正在尝试将我的服务器连接到本地 IP,但出现 fatal error 我已将 pg_hba.conf 和 postgresql.conf 文件从 localhost 修改为我的 IP 地址。 谁能帮帮我

这是我的 pg_hba.conf.sample enter image description here

最佳答案

您可以为您的连接添加一条额外的线路

host   all   all   all   md5

这将需要您要连接的 PostgreSQL 用户的密码。例如,您可以通过从 psql 终端执行以下操作来为您的 postgres 用户添加密码

ALTER USER postgres WITH PASSWORD 'postgres';

然后你就可以连接用户名:postgres 密码:postgres

如果这可行,您可能需要进行一些调整以使其更安全

关于postgresql - 无法使用本地 IP 地址作为我的主机连接到 postgres 服务器(例如 : 192. 168.x.x),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42641551/

相关文章:

ruby-on-rails - 基于小时的 ActiveRecord 范围

postgresql - 无法从外部连接到 postgresql 服务器

postgresql - 在 pgAdmin 中隐藏模板数据库

django - 关系不存在,在 PostgreSQL、Django 中

postgresql - 如何在 PostgreSQL 中存储一组查询,以便我可以轻松地再次运行它?

ruby-on-rails-3 - Rails 3.1 postgresql 将空白射入数据库

sql - 为什么这个查询需要聚合?

postgresql - "peer authentication failed"将数据加载到 PostgreSQL 时出错

python - 参数 ?不使用 python postgres

java - JDBC 连接池 : connections are not recycled after DB restart