相关疑难解决方法(0)

没有主机的pg_hba.conf条目

当我尝试使用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 perl database-permissions

56
推荐指数
7
解决办法
17万
查看次数

Postgresql:连接被拒绝.检查主机名和端口是否正确以及postmaster是否接受TCP/IP连接

我试图连接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)

如果有人愿意解释这里有什么问题,我将非常感激,我该如何纠正它.

postgresql

52
推荐指数
1
解决办法
21万
查看次数

使用不带密码的psql命令运行批处理文件

我试图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)

问题是每次执行批处理脚本时都要求输入密码.如何通过批处理文件密码参数?

postgresql connection shell psql

26
推荐指数
1
解决办法
4万
查看次数