postgresql pg_hba.conf主机“103.244.174.70”,用户“postgres”,数据库“patientlist”的条目,无加密,当从nodejs sequelize-auto连接到db时

dnph8jn4  于 2023-06-22  发布在  PostgreSQL
关注(0)|答案(1)|浏览(153)
ConnectionError [SequelizeConnectionError]: no pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption
    at Client._connectionCallback (C:\Users\hamza\nx gen\patient record system\backend\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:143:24)
    at Client._handleErrorWhileConnecting (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:327:19)
    at Client._handleErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:347:19)
    at Connection.emit (node:events:390:28)
    at C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\connection.js:117:12
    at Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:40:17)
    at Socket.<anonymous> (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9) {
  parent: error: no pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption
      at Parser.parseErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:287:98)
      at Parser.handlePacket (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:126:29)
      at Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:39:38)
      at Socket.<anonymous> (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
      at Socket.emit (node:events:390:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:199:23)

得到此错误,并且无法使用Internet上提供的解决方案找到解决方案
尝试了几乎所有的解决方案,仍然得到这个错误

ewm0tg9j

ewm0tg9j1#

你不需要尝试“互联网上提供的解决方案”。你需要做的是去官方手册和类型“pg_hba.conf”到方便的搜索框。
这将带您到the page on pg_hba.conf,它解释了条目的含义以及何时重新加载文件。阅读并理解该页面后,您可以打开正确的访问。
注意:我希望IP地址是在一个私有网络上,因为你可能不想暴露作为postgres用户(或者如果可能的话任何其他用户)访问公共互联网。

相关问题