postgresql 全新安装后PostgreSQL“无法访问服务器配置文件(...)没有这样的文件或目录”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33216761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PostgreSQL "cannot access the server configuration file (...) No such file or directory" after clean install
提问by Ben
I just installed postgresql according to the official documentation: But for some reason it doesn't work. It did install using sudo apt-get postgres... etc. But the starting of the server doesn't seem to work.
我刚刚根据官方文档安装了 postgresql :但由于某种原因它不起作用。它确实使用 sudo apt-get postgres ... 等进行安装。但是服务器的启动似乎不起作用。
I tried starting the server according to their documentationbut mr. computer throws the following error to my head when entering this command:
我尝试根据他们的文档启动服务器,但先生。输入此命令时,计算机向我抛出以下错误:
Command:
命令:
user@user-noobcomputer:/usr/lib/postgresql/9.4$ bin/postgres -D /usr/local/pgsql/data/
Error:
错误:
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory"
I have no clue why this file doesn't exist. Can anyone help me find out how to get past this error message and get my postgres server up and running?
我不知道为什么这个文件不存在。谁能帮我找出如何绕过此错误消息并启动并运行我的 postgres 服务器?
回答by PabTorre
First make sure that the file is not installed. As super user update the mlocate database and then run an mlocate query for the file.
首先确保未安装该文件。作为超级用户更新 mlocate 数据库,然后对文件运行 mlocate 查询。
$updatedb
$locate postgresql.conf
this will return any file with that name in your system. If the file is located in the wrong folder, then it'll show up in that query.
这将返回系统中具有该名称的任何文件。如果文件位于错误的文件夹中,则它将显示在该查询中。
If not, may try going to PostgreSQL docsthey have a basic example of how this file would look. Try making a copy of the file with that setting.
如果没有,可以尝试访问PostgreSQL 文档,他们有一个关于此文件外观的基本示例。尝试使用该设置制作文件的副本。