0

I have installed PostgreSQL 13 in my mac using the edb installer with all the tools as per the installation guide now when I am trying to run the command for it in terminal /Library/PostgreSQL/15/bin/psql -U postgres I get an error stating

psql: error: could not connect to server: Connection refused
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I have referred to the documentation, tried reinstalling but unable to solve the issue.

  • Looks like the postgres server hasn't been started. Not sure how that's done on Mac systems. If it says it's running you might want to try another way of connecting rather than Unix domain sockets, e.g. try a TCP connection. – Sam Mason Jul 18 '23 at 11:53

1 Answers1

0

You get this error because the postgres server has not yet been started, run /Library/PostgreSQL/15/bin/pg_ctl -D 'your_data_file' start for postgres to start listening on that port.