Postgres Installation Error reading file postgresql.conf

扶醉桌前 提交于 2019-11-30 17:01:29

问题


I have Windows Server 2003 machine on which I tried to install Postgres 9.2. At the end of the installation it pops a warning saying

Problem running post-install step. Installation may not complete correctly. Error reading file C:\Program Files\PostgreSQL\9.2\data\postgresql.conf

I checked for the file postgresql.conf in C:\Program Files\PostgreSQL\9.2\data and found that it does not exist.

I also found that there is not much under the data folder except for pg_log folder which is also empty.

Any ideas on what I may be doing wrong?


回答1:


I recommend you to try following, it worked for me:

Make sure that the user that is logged in to the server has full control permissions for the postgres folder and it's sub-folders.

Run:

initdb -D <your new data folder>

and then:

pg_ctl -D <your new data folder> -l logfile start

If the problem continues, and postgres is installed under "Program Files", or the installation path contains a space character, try using a relative path for the data folder argument of pg_ctl. Such as: "..\data"




回答2:


I just stumbled over another issue: If the user name of the currently active user contains a space character, postgres will fail to install its services to begin with, which results in the same error message. Be careful about changing the user name, as this might brick your windows installation. Instead, create a new user with admin privileges and install postgres from there, and everything will work smoothly.

On top of that, you will have to use a "runas /user:postgres cmd" to get a command window that's any good, or else initdb won't work either.

I realize this answer is months late, but it might help someone else!




回答3:


Had this problem on Windows 10. For me the solution was to choose a locale different from [Default Locale] during install.



来源:https://stackoverflow.com/questions/16730405/postgres-installation-error-reading-file-postgresql-conf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!