PostgreSQL 12服务器远程设置问题

问题描述 投票:0回答:1

我已经在Linux Mint上成功地从源代码构建了PostgreSQL 12,它运行得很好。我使用命令行在本地创建了数据库,还使用命令行从Windows 10远程创建了数据库。 Linux机器使用的是静态IP,它也可以正常工作,我可以从网络中甚至屋外的其他计算机中将SSH SSH到其中。

所以,我的问题是,如何使我的Windows 10计算机通过pgAdmin或其他客户端连接到Linux数据库服务器?当我从Windows 10计算机上运行pgAdmin并尝试仅使用基本信息,未设置SSL设置或SSH隧道连接到服务器时,出现以下错误:

unable to connect to server: 

could not connect to server: Connection refused (Ox000027 40/1 0061) Is the server running on host 
"96.33.242.182" and accepting 
TCP/IP connections on port 5432'

如果尝试在打开SSL压缩的地方连接并设置SSH隧道设置,则会出现以下错误:

Unable to connect to server: 

server closed the connection unexpectedly 
This probably means the server terminated abnormally before or while processing the request.

我希望能够在外出时从所有Windows 10计算机以及Android手机上的客户端连接到我的Linux PostgreSQL服务器。这是我目前的目标。最后一个问题,我是否需要在客户端计算机上安装PostgreSQL才能连接到服务器并使用它?目前,我仅在一台Windows 10计算机上进行测试,并且确实安装了PostgreSQL 12。我曾尝试在Internet上搜索自己的答案,但我还是空白。

postgresql installation remote-access remote-server
1个回答
0
投票

您必须设置

listen_addresses = '*'

postgresql.conf中并重新启动PostgreSQL。

默认情况下,PostgreSQL仅接受本地连接。

© www.soinside.com 2019 - 2024. All rights reserved.