未配置对Postgresql服务器的远程访问

时间:2018-08-23 04:16:11

标签: postgresql server configuration-files

我想在其他终端上配置postgresql服务器。所以我使用ssh服务访问了该终端。在我的终端上,我已经安装了ubuntu 16.04,其他终端上已经安装了ubuntu服务器16.04。 所以我想在其他终端上安装PostgreSQL 9.6。我使用了命令:

$ sudo apt-get install postgresql-9.6

我们可以看到它成功安装,因为已为本地访问设置了端口。

tcp 0 0 127.0.0.1:5432 0.0.0.0:*听

我想配置对服务器的远程访问,如以下链接所示,对postgresql.conf文件和pg_hba.conf文件进行了更改:

https://blog.bigbinary.com/2016/01/23/configure-postgresql-to-allow-remote-connection.html

然后我使用以下命令重新启动服务器:

$ sudo服务postgresql重新启动

它仍然显示它在端口5432上设置为localhost,如下所示:

$ tcp 0 0 127.0.0.1:5432 0.0.0.0:*监听

我尝试了很多次,但仍然得到了相同的结果。我不知道怎么了。请帮助

1 个答案:

答案 0 :(得分:0)

好的,我得到了答案。只需取消注释“ listen_addresses ='*'”。太愚蠢了,谢谢你们的宝贵时间。