Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?

前端 未结 17 1570
北荒
北荒 2020-12-02 06:37

Before anything, please note that I have found several similar questions on Stack Overflow and articles all over the web, but none of those helped me fix my issue:

17条回答
  •  情深已故
    2020-12-02 07:39

    Step 1:

    cd /etc/postgresql/12/main/
    

    open file named postgresql.conf

    sudo nano postgresql.conf
    

    add this line to that file

    listen_addresses = '*'
    

    then open file named pg_hba.conf

    sudo nano pg_hba.conf
    

    and add this line to that file

    host  all  all 0.0.0.0/0 md5
    

    It allows access to all databases for all users with an encrypted password

    restart your server

    sudo /etc/init.d/postgresql restart
    

提交回复
热议问题