node myfile.js
我遇到了这个错误
error: no pg_hba.conf entry for host "...", user "...", database "...", ...
我该如何创建它,以及在我的应用程序目录中应该将其放在哪里?
下面是完整的错误消息。我更改了IP地址、用户名和数据库的字符串,但基本上看起来都一样。
events.js:72
throw er; // Unhandled 'error' event
^
error: no pg_hba.conf entry for host "00.000.000.00", user "username", database "databasename", SSL off
at Connection.parseE (/Users/user/workspace/MyApp/app/node_modules/pg/lib/connection.js:526:11)
at Connection.parseMessage (/Users/user/workspace/MyApp/app/node_modules/pg/lib/connection.js:356:17)
at Socket.<anonymous> (/Users/user/workspace/MyApp/app/node_modules/pg/lib/connection.js:105:22)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:748:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:410:10)
at emitReadable (_stream_readable.js:406:5)
at readableAddChunk (_stream_readable.js:168:9)
at Socket.Readable.push (_stream_readable.js:130:10)
编辑:我进行了更多的研究,并发现 'pg_hba.conf' 文件在我的
/usr/local/var/postgres
我将这一行添加到'pg_hba.conf'文件中。
# TYPE DATABASE USER ADDRESS METHOD
host all all trust
也尝试过
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5
但它一直说我的主机、用户、数据库等没有条目...我的'pg_hba.conf'语法有问题吗?
但它一直说我的主机、用户、数据库等没有条目...我的'pg_hba.conf'语法有问题吗?