Node.js 在aws云上托管的timescaleDB上没有主机的pg_hba.conf条目
我在aws上有一个时间刻度数据库,我正试图用我的nodejs脚本创建一个到它的连接 这是我的剧本Node.js 在aws云上托管的timescaleDB上没有主机的pg_hba.conf条目,node.js,postgresql,timescaledb,Node.js,Postgresql,Timescaledb,我在aws上有一个时间刻度数据库,我正试图用我的nodejs脚本创建一个到它的连接 这是我的剧本 const { Pool, Client } = require('pg') const connectionString = 'postgres://host:port/defaultdb?sslmode=require' const pool = new Pool({ connectionString: connectionSt
const { Pool, Client } = require('pg')
const connectionString = 'postgres://host:port/defaultdb?sslmode=require'
const pool = new Pool({
connectionString: connectionString,
})
pool.query('SELECT NOW()', (err, res) => {
console.log(err, res)
pool.end()
})
当我运行这个脚本时,我得到这个错误:主机没有pg_hba.conf条目。如何修复?在安装了postgres db服务器的aws上,编辑pg_hba.conf并添加您试图连接db服务器的客户端计算机的ip。在安装了postgres db服务器的aws上,编辑pg_hba.conf并添加您试图从中连接db服务器的客户端计算机的ip。