Skip to content

Instantly share code, notes, and snippets.

@akdmjeau-eng
Forked from hernandez87v/psql
Created March 4, 2026 21:10
Show Gist options
  • Select an option

  • Save akdmjeau-eng/695484efd11a521096d916e44c90186e to your computer and use it in GitHub Desktop.

Select an option

Save akdmjeau-eng/695484efd11a521096d916e44c90186e to your computer and use it in GitHub Desktop.
PostgresSQL - createuser: 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?
# createuser: 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?
# List clusters running on device
pg_lsclusters
# It will likely show Status down
# Restart pg_ctlclusters
#format is pg_ctlcluster <version> <cluster> <action>
sudo pg_ctlcluster <version> main start
#restart PostgreSQL service
sudo service postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment