0

我不知道为什么会收到此错误消息:

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'
4

1 回答 1

0

默认情况下,postgres 使用基于 IDENT 的身份验证。因此,“Ident authentication failed”与pg_hba.conf配置文件有关。在psql命令行中,您可以通过键入以下内容找到此文件:

postgres=> show hba_file;

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

于 2018-11-10T11:43:17.723 回答