Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
41611 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


    Ảnh đại diện
    Huỷ bỏ
    Câu trả lời hay nhất

    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

    Ảnh đại diện
    Huỷ bỏ
    Tác giả

    not working for me

    Câu trả lời hay nhất

    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? - - -



    Ảnh đại diện
    Huỷ bỏ
    Bài viết liên quan Trả lời Lượt xem Hoạt động
    0
    thg 8 22
    1644
    0
    thg 8 23
    1593
    3
    thg 5 24
    8182
    1
    thg 3 15
    5751
    0
    thg 2 22
    6846