Centos postgres 连接
Centos postgres connect
当您尝试连接到 postgres 时:
# psql -h localhost dgrt postgres
I get an error:
#User "postgres" has not passed authentication (Ident)
配置我的文件
postgresql.conf:
listen_addresses = '*'
pg_hba.conf:
#Allow replication connections from localhost, by a user with the
#replication privilege.
host all all 127.0.0.1/32 ident
使用 ident
auth,您需要以正确的 OS 用户身份启动命令,即数据库用户名必须与本地主机上的 OS 用户名匹配。
例如(作为 root)你可以这样做:
# su postgres -c 'psql dgrt'
这同样适用于与远程主机的连接。详情请参考文档
供参考:
当您尝试连接到 postgres 时:
# psql -h localhost dgrt postgres
I get an error:
#User "postgres" has not passed authentication (Ident)
配置我的文件 postgresql.conf:
listen_addresses = '*'
pg_hba.conf:
#Allow replication connections from localhost, by a user with the
#replication privilege.
host all all 127.0.0.1/32 ident
使用 ident
auth,您需要以正确的 OS 用户身份启动命令,即数据库用户名必须与本地主机上的 OS 用户名匹配。
例如(作为 root)你可以这样做:
# su postgres -c 'psql dgrt'
这同样适用于与远程主机的连接。详情请参考文档
供参考: