# "local” is for Unix domain socket connections only
#local all all peer
local all all trust
# IPv4 local connections:
#host all all 127.0.0.1/32 ident
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 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#hcst replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
最后使用命令重启数据库。
7.配置数据库账号和密码,以及建立所需表格:
a.设置数据库账号和密码:
设置数据库密码为:antiroot
su - postgres
psql
ALTER USER postgres WITH PASSWORD 'antiroot';
CREATE USER postgres WITH SUPERUSER PASSWORD 'antiroot';