node.js - 无法从 Node 服务器连接到 postgres 数据库

标签 node.js linux postgresql

我想使用node-posgres 将我的应用程序nodejs 连接到PostgreSQL。我的应用程序在Linux服务器上,我的postgresql在另一个Linux服务器上,IP地址为176.9.154.123。

这是我的错误:

enter image description here

这是我的 pg_hba.conf:

host    all             all             176.9.154.123/32        trust

最佳答案

我可以通过将此行添加到 postgresql.conf 来解决此问题:

listen_addresses = '*'

关于node.js - 无法从 Node 服务器连接到 postgres 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57439554/

相关文章:

javascript - JavaScript 中的重构模式

c - 在 Unix 中崩溃时自动释放互斥锁

c - Linux block 过滤器驱动程序

security - 严格控制PostgreSQL中的statement_timeout变量

postgresql - 比较函数中的 postgresql 枚举

postgresql - 在 Where 子句中使用 Upper 和 Lower Function 有什么区别?

javascript - `await` 命令导致变量失去作用域

node.js - vscode 无法启动 Node 应用程序

linux - shell中的空间有什么用?

node.js - Azure blob sasToken "Signature did not match"