home   tags    

Dec. 25, 2023

No /var/run/postgresql/.s.PGSQL after reboot (Ubuntu)

Rebooting the server, bumped into the following error, preventing my django server from functioning: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.xxxx" failed: No such file or directory


Not to easy to search the solution, tons of search spam (and of course stupid advises "purge porstgresql including databases and all the files and reinstall".


Thanks to Abdallah: https://www.abdallahyashir.com/how-to-fix-postgresql-error-connection-to-server-on-socket-failed/

$ sudo -i -u postgres
$ /usr/lib/postgresql/14/bin/pg_ctl restart -D /var/lib/postgresql/14/main




#linux #postgresql #django