CentOS配置postgresql9.3远程连接

命令行postgresql远程连接

进入安装目录

1
$ cd /var/lib/pgsql/9.3/data

编辑postgresql.conf

找到listen_addresses项,将值localhost改为*,并去掉行首的注释符号#。

编辑pg_hba.conf

在host all all 127.0.0.1/32 md5这一行下面添加如下配置,或者修改这一行为如下配置:
host all all 0.0.0.0/0 trust
注意:网上大部分都是说改成host all all 0.0.0.0/0 md5,但是我改成这样,远程连接一直失败,提示用户密码不正确。

热评文章