尝试远程访问postgresql总是超时
我试图“启用”我的postgresql13可以远程访问。 所以我尝试通过pgadmin4连接,它总是说:尝试远程访问postgresql总是超时,postgresql,pgadmin,pgadmin-4,Postgresql,Pgadmin,Pgadmin 4,我试图“启用”我的postgresql13可以远程访问。 所以我尝试通过pgadmin4连接,它总是说: Unable to connect to server: timeout expired 使用命令检查时的ip ip a 它给了我 192.168.xxx.xxx/24 已经尝试了使用“/24”和不使用它 这是我的pg_hba.conf # TYPE DATABASE USER ADDRESS METHOD #
Unable to connect to server:
timeout expired
使用命令检查时的ip
ip a
它给了我
192.168.xxx.xxx/24
已经尝试了使用“/24”和不使用它
这是我的pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
host all all all md5
这是我的postgresql.conf
# - Connection Settings -
#listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5435 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
我已经在这里和那里阅读了多个源,将侦听地址更改为“*”,如果要更改端口,请在postgresql.conf port=desiredport中更改它
我错过什么了吗
这是我在pgadmin4中输入的内容
主机不存在,或者您有网络或防火墙问题。此外,您忘了删除
侦听地址的注释。
主机存在并且正常。我刚刚意识到侦听地址的注释,并且已经删除了注释,端口=5435。同样在防火墙中,我已经允许该端口。现在我真的很困惑,因为就像我在谷歌上尝试了所有东西一样:'(顺便说一句,在我删除了评论之后,我也已经重新启动了服务。你一定忘记了防火墙或其他一些网络问题。防火墙可能存在于多个地方。