i wanted to log in to continue but i keep on getting an error when logging into to postgres database even though my progress is not lost.
camper@4963e6ac68db:/workspace/project$ psql --username=freecodecamp --dbname=mario_database
psql: error: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Challenge Information:
Learn Relational Databases by Building a Database of Video Game Characters - Build a Database of Video Game Characters
unfortunately I can’t help further. When I get this error, the reset button works for me. (I may need to open a new bash terminal but that’s all I ever needed to get the setup for postgres back)
So just to be sure you know exactly how it works for me.
1- click Reset
2- open new bash terminal
3- the colors on the prompt should be blue now (not green)
4- run the psql statement from the new terminal
i don’t think it is related to git as git is a tool used to keep track of changes made to files.
It may be related to docker, but I’m not sure what else to suggest here.
maybe you can try looking for a .freeCodeCamp directory in your bash terminal
If you can find it, cd to it and run npm install
then after that try the reset again
i read some more old posts and some thoughts on this include that you can try moving on to a different project.
If you move on to a different project without deleting your current container that may somehow help reset something.
(run them in order) sudo chown -R postgres:postgres /var/lib/postgresql/12/main
sudo service postgresql stop && sudo service postgresql start && echo "SELECT 'CREATE USER freecodecamp WITH CREATEDB' WHERE NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname='freecodecamp')\gexec" | psql -U postgres -X