find / -name 'pg_hba.conf'
/var/lib/pgsql/data/pg_hba.conf
修改文件:
# "local" is for Unix domain socket connections only
local all all Peer
# IPv4 local connections:
host all all 127.0.0.1/32 Ident
# IPv6 local connections:
host all all ::1/128 Ident
新文件为:
# "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
本文详细介绍了如何将PostgreSQL数据库的认证方式从Peer和Ident更改为md5,涉及修改pg_hba.conf配置文件的具体步骤。通过更改认证方式,可以增强数据库的安全性。
1837

被折叠的 条评论
为什么被折叠?



