Cannot connect to postgres from remote host

前端 未结 6 1279
刺人心
刺人心 2020-12-13 12:50

I have a database server (192.168.1.50) running postgres. I have created a database named \"testdb\" and a user \"testuser\" with password \"testuserpw\".
Locally, I can

6条回答
  •  粉色の甜心
    2020-12-13 13:48

    I came across the same problem as yours, and my source of problem is the firewall settings. If you're using Ubuntu, print your firewall status: sudo ufw status verbose

    It may looks like this:

    Logging: on (low)
    Default: deny (incoming), allow (outgoing), disabled (routed)
    New profiles: skip
    ...
    

    The default rule of incoming connection is "deny", so you need to specify the "allow"ed port.

    type: sudo ufw allow 5432/tcp

    reference: https://www.vultr.com/docs/how-to-configure-ufw-firewall-on-ubuntu-14-04

提交回复
热议问题