PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
来源:互联网 发布:360网络摘文手下载 编辑:程序博客网 时间:2024/04/28 00:57
PostgreSQ数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,会报一些如下的异常:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
要解决这个问题,只需要在PostgreSQL数据库的安装目录下找到/data/pg_hba.conf,找到“# IPv4 local connections:”
1、允许本地使用PGAdmin3登录数据库,数据库地址localhost,用户user1,数据库user1db:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
要解决这个问题,只需要在PostgreSQL数据库的安装目录下找到/data/pg_hba.conf,找到“# IPv4 local connections:”
1、允许本地使用PGAdmin3登录数据库,数据库地址localhost,用户user1,数据库user1db:
1
host user1db user1 127.0.0.1/32 md5
2、允许10.1.1.0~10.1.1.255网段登录数据库:
1
host all all 10.1.1.0/24 md5
3、信任192.168.1.10登录数据库:
1
host all all 192.168.1.10/32 trust
pg_hba.conf修改后,使用pg_ctl reload重新读取pg_hba.conf文件,如果pg_ctl找不到数据库,则用-D /.../pgsql/data/ 指定数据库目录,或export PGDATA=/.../pgsql/data/ 导入环境变量。
另:PostgreSQL默认只监听本地端口,用netstat -tuln只会看到“tcp 127.0.0.1:5432 LISTEN”。修改postgresql.conf中的listen_address=*,监听所有端口,这样远程才能通过TCP/IP登录数据库,用netstat -tuln会看到“tcp 0.0.0.0:5432 LISTEN”
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQL 连接问题 FATAL: no pg_hba.conf entry for host
- PostgreSQL 连接问题 FATAL: no pg_hba.conf entry for host
- FATAL: no pg_hba.conf entry for host "::1" odoo10连接postgre navicate连接问题
- Navicat Premium远程连接GP(Greenplum)集群 解决FATAL:no pg_hba.conf entry for host "172.20.20.2"问题
- postgresql Connection to database failed: FATAL: no pg_hba.conf entry for host "10.129.195.161", us
- SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry
- Greenplum pg_hba.conf entry for host "192.168.2.111", user "gpadmin", database "template1", SSL off
- 程序链接PostgreSQL 时报错"no pg_hba.conf entry"
- pg_hba.conf
- no entry for pthread_cond_wait
- postgresql pg_hba.conf 文件
- Unable to connect to PostgreSQL server: FATAL: missing or erroneous pg_hba.conf file\nHINT: See se
- No manual entry for fork
- IOCP的例子
- NSOperation的介绍和使用
- CoreMotion可以测到的各种值
- scala对Set的操作
- IOCP
- PostgreSQ 连接问题 FATAL: no pg_hba.conf entry for host
- 从文件资源里获取文本
- (13) - 内省和注解 (图)
- scala对filter的操作
- GDC介绍和使用
- C++ 传值,传引用和传指针-参考Effective C++ 第三版Item20~21
- Spring(事务通配符)
- 109个程序员常去的网站
- python实现的prim算法求MST O(MN)