4

我使用名为 postgres 的本地计算机帐户安装了带有 Windows 服务的 pgAgent。我已确认 Windows 服务运行正常。我在 pgAdmin 中创建了一个作业,应该从我的客户数据库中的表中删除某些记录。作业中的唯一步骤是配置到客户数据库的本地连接类型。问题是,作业每次都失败,并在 Windows 事件日志中写入以下警告:

Failed to create new connection to database 'customer':'fe_sendauth: no password supplied'

我已经验证在 C:\Users\postgres\AppData\Roaming\postgresql 中有一个 pgpass.conf 文件。以下是它的内容:

localhost:5432:postgres:postgres:<password_redacted>

我不确定还能尝试什么。我无法找到有关此错误消息的任何进一步信息,因为它适用于 pgAgent。

版本信息:

  • PostgreSQL 9.2.4,由 Visual C++ build 1600 编译,64 位
  • pgAdmin 1.16.1
  • pgAgent v3.3.0-1

Windows服务启动信息:

C:\Program Files (x86)\pgAgent\bin\pgagent.exe RUN pgAgent host=localhost port=5432 user=postgres dbname=postgres

pg_hba.conf 的非注释内容:

host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5
4

3 回答 3

2

我所做的是在 PgAgentIII 的工作步骤下

我将连接类型更改为远程
使用按钮设置连接字符串...
将用户=postgres更改为我的应用程序用户名
添加密码=密码(填写您的密码)
更改主机=127.0.0.1

我不再收到错误

于 2013-04-09T19:46:55.317 回答
0

我在为本地连接配置的 pgAgent 作业步骤中遇到了同样的问题:
Failed to create new connection to database '<database_name>':'fe_sendauth: no password supplied'

将密码放入连接字符串的解决方案工作正常,但似乎不安全。

在四处挖掘之后,我找到了另一个解决方案 - 为步骤的目标数据库添加连接字符串到 pgpass.conf 解决了这个问题:
localhost:5432:<database_name>:postgres:<password>

于 2013-05-29T07:27:05.307 回答
-1

确保检查 pgadmin 服务的用户名和您正在检查的 pgpass.conf 文件的用户名是否匹配。在我意识到 pgadmin 安装程序已将服务设置为以本地用户身份运行之前,我遇到了同样的问题,并且我正在检查 pgpass.conf 中与域用户相同的用户名。

于 2014-05-20T21:57:53.770 回答