2012-08-01 80 views
0

我想在Windows上安裝pgAgent服務。雖然它使用以下命令安裝好了:由於登錄失敗而無法啓動pgAgent

C:\Program Files (x86)\pgAdmin III\1.14>pgagent.exe INSTALL pgAgent -l2 -u postgres hostaddr=localhost port=5432 dbname=postgres user=postgres 

的服務沒有啓動給了一個錯誤:Windows無法在本地計算機上啓動pgAgent服務。錯誤1069:由於登錄失敗,服務未啓動。

使用pgpass.conf文件提供密碼。 pgAdmin正在使用相同的密碼登錄到數據庫。

我甚至嘗試在命令行中使用-p選項提供相同的密碼(如pgpass.conf)。它也沒有工作,但錯誤是不同的。在命令行上它說服務無法啓動。服務報告沒有錯誤。然而,當我看到日誌在控制面板/事件查看器下面的警告顯示:

,然後一個錯誤:

Stopping pgAgent: Couldn't establish the primary connection with the database server. 

如果能幫上忙,我單獨下載pgAgent並放置在pgAgent.exe pgAdmin的III/1.14文件夾libpq.dll也駐留。我使用的是PostgreSQL 9.0,pgAdmin 1.14和pgAgent 3.0.0

有人可以幫我解決嗎?

+0

pgAgent服務使用哪個帳戶? – 2012-08-01 16:26:56

+0

錯誤消息是指登錄到Windows **而不是Postgres。所以一個pgpass.conf不會幫你。 – 2012-08-01 18:42:34

+0

@ MilenA.Radev postgres是pgAgent服務所使用的帳戶,與PostgeSQL服務使用的帳戶相同 – wazzz 2012-08-02 08:44:11

回答

0

好男人,我能夠解決這個問題,重新安裝PostgreSQL,然後用StackBuilder安裝pgAgent。

1

轉到pgAgent在Windows安裝文件夾,並執行

C:\Program Files (x86)\pgAgent\bin>pgagent REMOVE pgAgent 


這將刪除現有的配置錯誤的窗口服務
然後重新安裝該服務通過以下方式給予正確的密碼憑據。第一個-u給出了在windows上創建的postgres用戶,而連接字符串中的第二個用戶名是db用戶名。
執行以下操作後,如果仍然看到錯誤,請啓動服務並檢查事件查看器。

C:\Program Files (x86)\pgAgent\bin>pgagent --help 
Usage: 
pgagent REMOVE <serviceName> 
pgagent INSTALL <serviceName> [options] <connect-string> 
pgagent DEBUG [options] <connect-string> 
options: 
-u <user or DOMAIN\user> 
-p <password> 
-d <displayname> 
-t <poll time interval in seconds (default 10)> 
-r <retry period after connection abort in seconds (>=10, default 30)> 
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)> 

C:\Program Files (x86)\pgAgent\bin>pgagent INSTALL pgAgent -u postgres -p admin 
-l 2 hostaddr=127.0.0.1 port=5433 user=postgres dbname=first password=admin 
相關問題