【发布时间】:2021-07-03 02:41:24
【问题描述】:
我尝试将 postgresql 配置为能够“远程”连接到 pgadmin4 所以我在服务器上安装了 postgresql 版本 13,并尝试通过我的笔记本电脑访问它。
但是为什么总是报错,我刚改了密码,在pgadmin4里输入用户名和密码,还是说密码认证。
这是我的 pghba.conf 文件。
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
这是我的 postgesql.conf 文件
listen_addresses = '*'
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5434 # (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)
# - TCP settings -
# see "man tcp" for details
#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds;
# 0 selects the system default
# - Authentication -
#authentication_timeout = 1min # 1s-600s
password_encryption = scram-sha-256 # md5 or scram-sha-256
#db_user_namespace = off
# GSSAPI using Kerberos
#krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab'
#krb_caseins_users = off
我仍然不知道为什么,也许有人经历过同样的事情?或者有什么想法? 仅供参考:我打开 pgadmin4 应用程序和 url 去这个:http://127.0.0.1:60888/browser/
【问题讨论】:
-
您展示的 pg_hba 永远不会尝试密码验证,因此它不会失败。您似乎没有尝试连接到您认为的服务器。
标签: postgresql pgadmin pgadmin-4