本地计算机上的postgresql-x64-9.6服务启动后又停止。有些服务在不使用的情况下会自动停止[英] The postgresql-x64-9.6 service on local computer started and then stopped. Some services stop automatically if they are not in use

本文是小编为大家收集整理的关于本地计算机上的postgresql-x64-9.6服务启动后又停止。有些服务在不使用的情况下会自动停止的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

postgresql服务不在services.msc中启动.它在启动Window Server 2008 R2中启动PostgreSQL服务时显示以下消息.

"本地计算机上的postgresql-x64-9.6服务开始然后停止.如果其他服务或程序不使用它们,则某些服务会自动停止."

 image

推荐答案

我也有同样的问题.我遵循@craig Ringer的建议.当我检查事件查看器时,我会收到此错误.2018-06-18 12:34:11.222 GMT [4200] FATAL: lock file "postmaster.pid" already exists 2018-06-18 12:34:11.222 GMT [4200] HINT: Is another postmaster (PID 6172) running in data directory "C:/Program Files/PostgreSQL/10/data"?因此,我在PostgreSQL数据目录中删除了" postmaster.pid"文件,重新开始服务,这一次,服务正常启动. 此错误可能是由于PostgreSQL服务的关闭不完整.

其他推荐答案

由于某些原因,PostgreSQL进程仍在后台运行.

,如果您的系统强行关闭系统,则可以遇到此问题. 解决方案:

  1. Windows + X(打开任务管理器 - 进程)

  2. 查找所有运行的PostgreSQL服务和"结束任务".

所有过程结束后.您可以重新打开任务管理器,以确保没有Postgres服务正在运行.

  1. 重新启动PostgreSQL Server

其他推荐答案

我在这里还有其他答案,说明为什么会出现某种误导性错误消息,现在是一个较新的版本,12.2 vs 9.6(" PostgreSQL-X64-12-Postgresql 12 Server Server在本地计算机上启动然后停止.如果其他服务或程序不使用它们,则某些服务会自动停止.)

显然,pg_hba.conf文件中的错误将导致上面的错误消息出现,并且服务未能启动.

就我而言,我已经编辑了该文件,但没有正确评论(#)评论.经过大量的谷歌搜索,我从未见过提到过,但终于记得仔细检查了我的编辑,问题是一个简单的错误.

我修复了它,现在开始服务,没问题.

- Windows 10 X64 Enterprise 1909 18363.752 -postgresql 12.2(Windows)

本文地址:https://www.itbaoku.cn/post/1763754.html

问题描述

Postgresql service not starting in services.msc. it is showing below message while starting PostgreSQL service in Window server 2008 R2.

" The postgresql-x64-9.6 service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."

image

推荐答案

I had this same issue. and i followed @Craig Ringer's advice. when i check the event viewer i got this error.2018-06-18 12:34:11.222 GMT [4200] FATAL: lock file "postmaster.pid" already exists 2018-06-18 12:34:11.222 GMT [4200] HINT: Is another postmaster (PID 6172) running in data directory "C:/Program Files/PostgreSQL/10/data"? so i deleted the "postmaster.pid" file in my postgreSQL data directory, start the service again and this time around, the service started properly. This error might be due to incomplete shutdown of the postgreSQL service.

其他推荐答案

For some reasons postgresql process is still running in the background.

You can encounter this problem if your system forcefully shutdowns down. Solution:

  1. Windows + X (Open task Manager - Processes)

  2. Find all running postgresql services and 'End Task'.

After all processes have ended. You can reopen task manager to ensure no postgres services is running.

  1. Restart Postgresql server

其他推荐答案

I have an additional answer to the ones here as to why the somewhat misleading error message can occur, which is now a newer version, 12.2 vs 9.6, ("The postgresql-x64-12 - PostgreSQL 12 Server service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.)

Apparently, errors in the pg_hba.conf file will cause the error message above to appear, and the service failed to start.

In my case, I had edited the file and failed to comment out (#) a comment properly. After much Googling, I never saw that mentioned but DID finally remember to double-check my edits, and there the problem was a simple mistake.

I fixed it and the service now starts, no problem.

-Windows 10 x64 Enterprise 1909 18363.752 -PostgreSQL 12.2 (Windows)