Getting psql:error all of a sudden

codeally@8576f6138a56:~/project$ psql -U postgres < periodic_table.sql
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?

Does this mean that the server used to connect to the database is down? I was coding when I got a message stating that could not be saved…
So I copied my code to a backup location. Did I code something that crashed the server???

1 Like

Wish we could get an answer to this

When I got this error, I did a little research and found that it might be caused by an incorrect value saved somewhere in the dbname= part of the psql command. I couldn’t find one, so I made a dump of the database and copied my .sh file to my hard drive and deleted the project from the codeally website. When I restarted the project from scratch on freecodecamp, the error was gone. Then I copied my saved sql and .sh files into the project folder and continued from there.
Good luck!

hi Carol, can you tell me how to use a saved sql to get back your db/table setup? (is there a command to do it?)

I copied the saved sql file from my hard drive into an empty file in the project folder on codeally and saved it as whatever-name.sql. Then you need to be in the project folder in a terminal and type “psql -U freecodecamp dbnamegoeshere < whatever-name.sql” (without the double quotes). That should unpack the database stored in the sql file and make it available. I’m pretty sure that will work.

1 Like

I have the same issue, when trying to run it locally