Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在aws云上托管的timescaleDB上没有主机的pg_hba.conf条目_Node.js_Postgresql_Timescaledb - Fatal编程技术网

Node.js 在aws云上托管的timescaleDB上没有主机的pg_hba.conf条目

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

我在aws上有一个时间刻度数据库,我正试图用我的nodejs脚本创建一个到它的连接

这是我的剧本

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。