简体   繁体   中英

PostgreSQL “cannot access the server configuration file (…) No such file or directory” after clean install

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.

I tried starting the server according to their documentation but 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?

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.

$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 docs they have a basic example of how this file would look. Try making a copy of the file with that setting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM