PostgreSQL不会再启动了

今天,我的PostgreSQL不能在我的Windows机器上启动…

我试图在Windows服务启动服务,并得到以下错误:

Windows could not start the PostgreSQL Database Server 8.3 service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion. 

然后我去命令行手动启动C:/ Program Files(x86)/PostgreSQL/8.3/bin/psql.exe,然后我得到这个错误:

 psql: Could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432? 

编辑:我发现这在日志中:

 2011-04-22 13:13:16 CEST LOG: could not receive data from client: No connection could be made because the target machine actively refused it. 2011-04-22 13:13:16 CEST LOG: unexpected EOF on client connection 

PostgreSQL在启动时出现错误,并找出你将不得不手动启动PostgreSQL。 PostgreSQL不会像你希望的那样频繁地logging它的启动失败,而且我怎么知道怎么回事呢是通过在postgres用户下启动一个cmd.exe窗口并手动启动PostgreSQL。

运行这个在postgres用户下启动一个CMD.exe

 runas /user:postgres cmd.exe 

inputpostgres密码。 然后在那个新的CMD窗口中启动PostgreSQL

 "C:/Program Files (x86)/PostgreSQL/8.3/bin/postgres.exe" -D "C:/Program Files (x86)/PostgreSQL/8.3/data" 

让我们知道输出…

该日志数据来自正在运行的服务器! 这是最新的日志的结束,如果它甚至不似乎创build新的日志文件了。

当postgresql启动时,使用-D选项将path传递到数据文件夹。 如果你去的Windows服务经理,你应该能够检查那里的path。 看看是否符合实际的path。 如果它包含正斜杠,而不是在这种情况下是正常的反斜杠。 如果path是错误的,你将不得不深入到registry来纠正它,因为服务经理不给你一个方法来改变它。

在服务pipe理器中,同时检查postgres服务在postgres用户帐户下运行。

同时检查postgres用户对数据文件夹的所有权利。 其他用户不应该拥有该文件夹的权限。

如果这没有帮助,也许你最好尝试备份你的数据文件夹。 卸载postgres重新安装相同的版本。 不要放回你的备份,首先检查它是否工作。 然后停止服务器把备份启动服务器,并保持你的手指交叉。