Home  >  Article  >  Database  >  解决不能连接远程postgresql

解决不能连接远程postgresql

WBOY
WBOYOriginal
2016-06-07 16:11:141220browse

在远程服务器上安装了postgresql,用 pgAdmin添加服务器始终不行。 解决办法: 在远程的postgresql数据库上的pg_hba.conf中添加 host all all 0.0.0.0/0 trust 并保证postgresql.conf 中参数设置为listen_addresses = '*' 修改完毕后重启: /bea/PostgreSQL/

在远程服务器上安装了postgresql,用 pgAdmin添加服务器始终不行。

解决办法:

在远程的postgresql数据库上的pg_hba.conf中添加 host all all 0.0.0.0/0 trust

并保证postgresql.conf 中参数设置为listen_addresses = '*'

修改完毕后重启:

/bea/PostgreSQL/9.3/bin/pg_ctl stop

/bea/PostgreSQL/9.3/bin/pg_ctl start

启动过程中如果报,pg_ctl: no database directory specified and environment variable PGDATA unset 则设置下环境变量

PGDATA=/bea/PostgreSQL/9.3/data
export PGDATA

如果报CST LOG: could not create IPv6 socket: 协议不支持的地址族,忽略,不影响连接

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn