Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 247
Ben Avatar asked Oct 19 '15 14:10

Ben


1 Answers

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.

like image 158
PabTorre Avatar answered Nov 15 '22 10:11

PabTorre