PG::ConnectionBad: fe_sendauth: no password supplied

后端 未结 6 876
再見小時候
再見小時候 2020-12-04 18:59

When I attempt to run \"rake test\" on a local postgres database, it throws the above exception.

Here is my pg_hba.conf file: # Database administrative login by

6条回答
  •  不知归路
    2020-12-04 19:49

    Change the code as below and it will work

    pg_hba.conf:
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
    # IPv6 local connections:
    host    all             all             ::1/128                 trust
    

    Below its explanation:

    trust

    Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they wish, without the need for a password or any other authentication.

    md5

    Require the client to supply a double-MD5-hashed password for authentication.

    refer for more here

提交回复
热议问题