PostgreSQL "cannot access the server configuration file (...) No such file or directory" after clean install

17,021

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.

Share:
17,021
Ben
Author by

Ben

Nieuwbe me

Updated on July 26, 2022

Comments

  • Ben
    Ben almost 2 years

    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?

  • Ben
    Ben over 8 years
    Thnx, I find the file in using the locate postgresql.conf command. But it still doesn't work though... I now get the following error: stackoverflow.com/questions/33229646/… I don't know whats wrong with my configuration
  • otocan
    otocan about 6 years
    Presuming one locates the config file (mine was in /etc/postgresql/), how does one proceed? There doesn't seem to be an option in postgres command to specify the location of the config. Is the only option to copy the config into the data directory?
  • otocan
    otocan about 6 years
    Ah, I've answered my own question: /usr/lib/postgresql/8.4/bin/postgres -D /var/lib/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf