Vm terminal issue with PSQL

hi, im working on the PSQL mario database crouse, when i enter “psql --username=freecodecamp dbname=postgres” on the terminal, it shows “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 issue. I tried to reset, but still does not work. Any solution?

I was able to connect it just now, can you try once more?


still doesnt work!

in dbname use the name of your mario database, so you connect dirtectly to that one

Can you try this command and report the return you see?

ps -ef | grep postgres


here is the return after the command

does not work. i reset the course back to the beginning, when i type psql --username=freecodecamp dbname=postgres into the terminal, it just return this 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?

can you post a link to the challenge (i want to try to see if mine will work)

here is the link to the challenge

have you tried the ‘if all else fails’ troubleshooting steps here Running the Relational Database Curriculum in your Browser

(where you delete the container entirely which would mean re-starting?)
The other option is to try to get postgresql restarted but without knowing what other services may be stopped, we may be just making more trouble down the road.