Postgresql 无法连接到服务器pgAdmin

Postgresql 无法连接到服务器pgAdmin,postgresql,postgresql-9.4,pgadmin,Postgresql,Postgresql 9.4,Pgadmin,我在我的Ubuntu虚拟机上安装了PostgreSQL(ip:192.168.195.95)。现在,我正在尝试使用pgAdmin(ip:192.168.195.1)从物理机器Windows访问数据库 我知道我必须在postgresql.conf和pg_hba.conf中进行更改,以允许客户端连接,因此我添加了以下内容: listen_addresses = '*' 在/etc/postgresql/9.4/main/postgresql.conf和 host all

我在我的Ubuntu虚拟机上安装了PostgreSQL(ip:192.168.195.95)。现在,我正在尝试使用pgAdmin(ip:192.168.195.1)从物理机器Windows访问数据库

我知道我必须在
postgresql.conf
pg_hba.conf
中进行更改,以允许客户端连接,因此我添加了以下内容:

listen_addresses = '*'
/etc/postgresql/9.4/main/postgresql.conf

host      all              all               192.168.195.95/24            md5
/etc/postgresql/9.4/main/pg_hba.conf
中,我重新启动了postgresql

错误信息:

Unable to connect to server:

could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "192.168.195.95" and accepting
TCP/IP connections on port 5432?

您能告诉我吗?

很抱歉键入错误,我的意思是/etc/postgresql/9.4/main/postgresql.confyes我使用了/etc/init.d/postgrestarterError保存属性:未经授权无法连接到服务器:无法连接到服务器:连接超时(0x0000274C/10060)服务器是否在主机“192.168.195.95”上运行,并在端口5432上接受TCP/IP连接?能否通过ssh连接到虚拟机,
sudo-postgres
并运行
psql-c“show listen_addresses”
?…请告诉我键入的完整命令抱歉键入错误,我的意思是/etc/postgresql/9.4/main/postgresql.confyes我使用/etc/init.d/postgresql重新启动错误保存属性:未经授权无法连接到服务器:无法连接到服务器:连接超时(0x0000274C/10060)是主机“192.168.195.95”上运行的服务器并在端口5432上接受TCP/IP连接?您可以通过ssh连接到虚拟机,
sudo-postgres
并运行
psql-c“show listen_addresses”
?…请告诉我键入的完整命令