如果我坚持以下默认设置,我的 postgresql 连接将有效:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all md5
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
现在我正在尝试允许同一家庭中的另一台计算机连接到当前服务器,并尝试一些设置。我所做的更改之一是对 IPv6 本地连接线,改用我的临时 IPv6 地址,因为如果我在 google 上检查我的 ip 是什么,那就是那里显示的 ip。
# IPv6 local connections:
host all all 1111:2222:a111:a11:b222:11a:abcd:efgs md5
(注意这里使用的ip只是一个例子)
但是,这会导致 postgresql 日志中出现以下错误:
2021-11-21 12:26:40.508 PST [10356] LOG: starting PostgreSQL 13.3, compiled by Visual C++ build 1914, 64-bit
2021-11-21 12:26:40.515 PST [10356] LOG: listening on IPv6 address "::", port 5432
2021-11-21 12:26:40.517 PST [10356] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-21 12:26:40.529 PST [10356] LOG: invalid IP mask "md5": Unknown host
2021-11-21 12:26:40.529 PST [10356] CONTEXT: line 88 of configuration file "C:/current_dir/PostgresSQL/data/pg_hba.conf"
2021-11-21 12:26:40.531 PST [10356] FATAL: could not load pg_hba.conf
2021-11-21 12:26:40.533 PST [10356] LOG: database system is shut down
请问造成这个错误的可能原因是什么?非常感谢。