Psycopg2 reporting pg_hba.conf error

前端 未结 2 1042
隐瞒了意图╮
隐瞒了意图╮ 2021-02-19 12:56

I\'ve run into a weird situation while trying to use PostgreSQL and Psycopg2. For some reason, every time I attempt to connect to the postgre database via python, I get the foll

2条回答
  •  暖寄归人
    2021-02-19 13:45

    Typical explanations include:

    • You are connecting to the wrong server.
      Is the DB server running on the same host as Python does?

    • You got the wrong port.
      Check the server log if you see a connection attempt. You have to log connections for that, of course. See the config parameter log_connections.

    • You did not reload (SIGHUP) the server after changing pg_hba.conf - or reloaded the wrong cluster (if you have multiple DB clusters).
      Use pg_ctl or pg_ctlcluser on Debian and derivatives for that.

提交回复
热议问题