postgres does not know where to find server configuration

In my case, I had to create a new database with host name

createdb hostname

I guess any other name might work equally well.

Then used psql command to connect to my newly created database.

psql mydbname

Worked like a charm.


Usually, when postgres is installed a service/daemon is created in the system so, there is no need to launch the server by hand. You are getting the error because the service is already running.

Try to connect to the database using psql


This worked for me:

sudo -u postgres psql

Tags:

Postgresql