簡體   English   中英

數據庫身份驗證失敗-Postgres

[英]DB authentication failed - postgres

我不知道為什么收到此錯誤消息:

DB authentication failed:
    SequelizeConnectionError: Ident authentication failed for user "smemamian"
        at connection.connect.err (/home/sunyar/API/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:108:24)

\\l命令行輸出:

postgres=> \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 sunyar    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | sunyardb=CTc/postgres+
           |          |          |             |             | smemamian=c/postgres
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres

我的數據庫連接變量:

DB_CONNECTION_URL = 'postgres://smemamian:123456@localhost:5432/sunyar'

默認情況下,postgres使用基於IDENT的身份驗證。 因此,“身份驗證失敗”與pg_hba.conf配置文件有關。 psql命令行中,可以通過鍵入以下內容找到該文件:

postgres=> show hba_file;

在此處查看參考: https : //www.postgresql.org/docs/9.1/auth-pg-hba-conf.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM