Cannot connect to postgres from remote host

前端 未结 6 1276
刺人心
刺人心 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:41

    The listen_address configvar in postgresql.conf is not the only way to get postgres to listen on the non-local IP-address (or addresses).

    Use option "-o -h *" if you start postgres from pg_ctl, otherwise do add "-h" "*" to the postgres command line, like e.g.

    /usr/local/pgsql/bin/postgres -D /pg/data "-h" "*"

    Of course /pg/data must be changed to your current datapath.

    This is especially useful when experimenting.

提交回复
热议问题