【发布时间】:2018-03-18 19:14:18
【问题描述】:
我正在尝试将我的 asp.net 核心应用程序发布到 linux (Centos) 机器上。在我解决问题时,这只是一个本地虚拟机。
我已经完成了我认为需要的所有步骤,但是当我尝试运行应用程序时,我收到了错误:
Unhandled Exception: System.AggregateException: One or more errors occurred. (28000: Ident authentication failed for user "postgres") ---> Npgsql.PostgresException: 28000: Ident authentication failed for user "postgres"
对于我的一生,我无法弄清楚发生了什么。由于这只是一个 VM 测试环境,因此我将每个密码(我的用户、root、两个 postgres 密码)都设置为相同的。所以我不太可能把它们混在一起。
我使用的连接字符串是:
"User ID=postgres;Password=password;Host=localhost;Port=5432;Database=cp1;Pooling=true;"
我的 pg_hba.conf 文件的内容是: # TYPE 数据库用户地址方法
# "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
host all all 127.0.0.1/32 password
local all postgres peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
最后几行是我自己无奈添加的。
我要尝试的东西已经不多了。任何人都可以提出可能导致这种情况的原因吗?
谢谢。
【问题讨论】:
标签: postgresql centos