Learn DB - Bulding a Mario Database - Cannot log in using postgres

Hi! I got problem with logging into the postgres service on VM. I’ve tried to find a solution for this in other topics related to that project but didn’t manage to find an answer.

I follow TUTORIAL.md and try to log in using command below:

psql --username=freecodecamp dbname=postgres

then I got the following error:

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?

then i tried to restart using command:

sudo service postgresql restart

after that error message when trying to log in has changed:

psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: Peer authentication failed for user “freecodecamp”

tried chrome instead of firefox and it works… So it can be closed

Using the reset button should have worked. I would try that if you run across this in the future.