Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
41603 มุมมอง

I got issue in my odoo 13 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

How can i solve this problem.Yesterday was everything working fine.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Goto Postgres Conf file pg_hba.conf and add your Postgres user in the format of

host    <user name>   <ip/network>   md5

For Example, create a new Postgres user odoo and add it section after Linux/UNIX domain.

Follow these steps:

  • Make a backup copy of the pg_hba.conf file before you alters it.
  • If the PostgreSQL postmaster is already running, stop it using the pg_ctl stop command or windows defined way.  
  • Open the pg_hba.conf file in a text editor. 
  • Here my IP is a default and not configured any extra. So using localhost/127.0.0.1 and update

  • # "local" is for Unix domain socket connections only, Here accepts all users and ips with peer auth
    local all all peer
    # Windows with new User odoo, all ips, with auth trust
    host all             odoo trust
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
  • you can change the auth method as md5/trust with a new user. The authentication method varies according to your needs. I can share with you the basic PSQL Windows deployment DOC.

    WIndows Postgres Deployment

    TO know more about the Postgres configuration file, please refer here

    https://www.postgresql.org/docs/9.3/auth-pg-hba-conf.html

    https://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-postgresql/configure-postgresql-accept-connections.htm


    อวตาร
    ละทิ้ง
    คำตอบที่ดีที่สุด

    Hi,

    Please check the answer given by Ermin here in this question and update the pg_hba.conf file accordingly: Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

    Thanks

    อวตาร
    ละทิ้ง
    ผู้เขียน

    not working for me

    คำตอบที่ดีที่สุด

    i have the same issue at linux environment i edited the pg_hpa.conf and it didn't work could anyone tell me the correct way to edit it (the line i should add and where should i add it exactly ) because I'm new to programming

        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
    psycopg2.OperationalError: could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432? - - -



    อวตาร
    ละทิ้ง
    Related Posts ตอบกลับ มุมมอง กิจกรรม
    0
    ส.ค. 22
    1642
    0
    ส.ค. 23
    1593
    3
    พ.ค. 24
    8178
    1
    มี.ค. 15
    5747
    0
    ก.พ. 22
    6841