当我尝试使用DBI连接时出现以下错误
DBI connect('database=chaosLRdb;host=192.168.0.1;port=5433','postgres',...)
failed: FATAL: no pg_hba.conf entry for host "192.168.0.1", user "postgres", database "chaosLRdb", SSL off
这是我的pg_hba.conf文件:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
host all postgres 127.0.0.1/32 trust
host all postgres 192.168.0.1/32 trust
host all all 192.168.0.1/32 trust
host all all 192.168.0.1/128 trust
host all all 192.168.0.1/32 md5
host chaosLRdb postgres 192.168.0.1/32 md5
local …Run Code Online (Sandbox Code Playgroud) 我试图连接postgresql但我收到此错误.
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Run Code Online (Sandbox Code Playgroud)
我的pg_hba.conf文件是这样的.
TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Run Code Online (Sandbox Code Playgroud)
如果有人愿意解释这里有什么问题,我将非常感激,我该如何纠正它.
我试图psql使用批处理脚本执行此命令:
psql --host=localhost --dbname=<dbname> --port=<Port Number>
--username=<dbuser> --file=C:\PSQL_Script.txt --output=C:\PSQL_Output.txt
Run Code Online (Sandbox Code Playgroud)
问题是每次执行批处理脚本时都要求输入密码.如何通过批处理文件密码参数?