【发布时间】:2020-03-01 01:43:15
【问题描述】:
请帮帮我。我有一些关于 pgAgent 的问题。
[环境]
DB : PostgreSQL 9.3
OS : Window 7
OS login ID : someid@mail.com
pgAdmin login ID : postgres
pgAgent user : postgres
pgAgent schema belongs to: postgres DB
DB that I'll treat : testDB (In Step configuration, I specified 'testDB' as Database.
Connection type is 'local'. Connection string is empty.)
DB server : local machine (my laptop computer)
我安排了 pgAgent 作业,但它无法连接数据库。
输出消息(pgAdmin>统计)
[Warning] Couldn't get a connection to the database (pgAgent)
(什么数据库?有2个数据库。'postgres'和'testDB'。我会处理'testDB'。然后无法连接到哪个数据库?)
Windows 事件查看器
Failed to create new connection to database 'testDB':'fe_sendauth: no password supplied'
我的 pgpass.conf
localhost:5432:postgres:postgres:[pgAdmin password for postgres]
localhost:5432:testDB:postgres:[pgAdmin password for postgres]
我的 pg_hba.conf
@remove-line-for-nolocal@# "local" is for Unix domain socket connections only
@remove-line-for-nolocal@local all all @authmethodlocal@
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 @authmethodhost@
# Allow replication connections from localhost, by a user with the
# replication privilege.
@remove-line-for-nolocal@#local replication @default_username@ @authmethodlocal@
#host replication @default_username@ 127.0.0.1/32 @authmethodhost@
#host replication @default_username@ ::1/128 @authmethodhost@
我的 pgAgent 命令选项(服务>pgAgent>属性>常规选项卡)
C:\Program Files (x86)\pgAgent\bin\pgagent.exe RUN pgAgent host=localhost port=5432 user=postgres dbname=postgres
pgAgent 服务登录 ID(Service>pgAgent>Property>Logon 选项卡)
id : someid@mail.com
pwd : [ someid@mail.com's password ]
[结论]
pgpass.conf 中的密码设置对于我所知道的任何事情来说似乎都是错误的。 或 pg_hba.conf 或 Services>pgAgent>Logon 中的登录 ID 其实..我真的不明白这是怎么回事。^^
提前感谢您的帮助^^
【问题讨论】:
-
Windows 事件查看器显示“与 testDB 的连接因密码而失败。”那么testDB密码的问题呢? (不是具有 pgAgent 架构的 postgres 数据库。登录到 postgres 数据库成功。)如果是这样,我该如何设置 testDB 密码?
-
我在步骤配置中将连接类型更改为“远程”(从“本地”)。并将连接字符串设置为 'user=postgres host=localhost port=5432 dbname=testDB password=[pgAdmin password for postgres]'。现在,工作成功。但是在 testDB 中什么也没发生。刚刚工作在统计面板上没有错误地结束。就这样。并且我想在 pgpass.conf 中设置密码。还有其他想法吗?
-
因为 someid@mail.com ?我应该创建“postgres”操作系统 ID 吗?并使用它登录 pgAgent ?
-
现在我正在尝试在我的 Windows 7 上创建“postgres”操作系统 ID。但我做不到。对于其他帐户没有问题。但对于“postgres”,我做不到。哈...不容易...
-
我猜 pgAgent 找不到 pgpass.conf 文件。所以我正在尝试制作“postgres”操作系统 ID。
标签: windows-7 postgresql-9.3 pgagent