Psql not connecting

I am trying to connect to the Postgres SQL, but its giving me this error.

I used this command:

psql --username=freecodecamp --dbname=postgres

psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.