经过很多天尝试连接到我的 PostgreSQL 实例后,我决定是时候寻求帮助了。
我正在尝试从 Windows 计算机连接到我的 PostgreSQL 数据库。
我正在尝试 pgAdmin 4 和 dBeaver,但都无法连接。下面是我使用 dBeaver 连接时收到的错误的屏幕截图。
我创建的连接是这样的:
我的用户是 (\du
):
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
umberto | Superuser, Create role, Create DB | {}
我的数据库(\l
):
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+---------+---------+-----------------------
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
umberto | umberto | UTF8 | C.UTF-8 | C.UTF-8 |
wondermap | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
不知道到底在哪里搜索日志来深入研究服务器计算机上的这个问题。我唯一能找到的是文件夹/var/log/postgresql
我只看到两个非 gzip 压缩文件,但这些消息指的是我尝试连接之前的几天。
最后,我的pg_hba.conf
:
# Database administrative login by Unix domain socket
local all postgres peer
# 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 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all ::0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
host all all ::/0 md5
可能是什么问题呢?