【发布时间】:2016-06-24 20:28:26
【问题描述】:
Windows 10 上的节点 v6.2; PG (node-postgres) v4.4.2
Ubuntu 14.04 Trusty VirtualBox 上的 Postgres 9.5
我正在使用 PG (node-postgres) 模块在虚拟机中连接到 Ubuntu 上的 Postgres。我能够使用 Navicat 连接没有问题,但是当我使用 NodeJS 连接时,这些相同的凭据不起作用。 postgres 日志显示:
xxxx@yyyy FATAL: password authentication failed for user "xxxx"
xxxx@yyyy DETAIL: Connection matched pg_hba.conf line 96: "host all all all $
我将此行添加到我的 pg_hba.conf 文件中,现在它可以工作了,但谁能解释为什么 md5 不工作?
# I added this line:
host all all all password
# This line was already here:
host all all all md5
【问题讨论】:
-
你的Node.js和
node-postgres是什么版本的?
标签: node.js postgresql node-postgres