I found some other Stack Overflow threads on this, but, after trying a lot of solutions, couldn't fix the problem.
Upon running the command psql -U postgres
, I got the following error message.
psql: error: could not connect to server: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"
Running the command pg_lsclusters
gave me this output:
12 main 5433 down <unknown> /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
Any thoughts?