【问题标题】:cannot remote connect to the postgresql server无法远程连接到 postgresql 服务器
【发布时间】:2015-10-28 22:53:21
【问题描述】:

我使用 virtualbox 和 vagrant 在我的 Mac 上安装了一个 Ubuntu 来宾。我在ubuntu上安装了postgresql 9.3。

我尝试从主机操作系统连接它。一直在超时。服务器是否在主机“11.11.11.18”上运行并在端口 5432 上接受 TCP/IP 连接。

我试过了,还是不行。

在流浪文件中。

ubuntu.vm.network "private_network", ip: "11.11.11.18"
ubuntu.vm.network "forwarded_port", guest: 3306, host: 3306
ubuntu.vm.network "forwarded_port", guest: 5432, host: 5432

pg_hba.conf

host all all 0.0.0.0/0 md5

postgresql.conf

listen_addresses='*'

我还需要检查什么?

【问题讨论】:

  • 如果你转发一个端口 - 你需要连接到本地主机
  • @zerkms,谢谢。现在可以了。

标签: postgresql


【解决方案1】:

转发端口后 - 您需要改为连接到 localhost。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-08
    • 2016-04-20
    • 2011-04-29
    相关资源
    最近更新 更多