-1

I installed PostGreSQL 14 via Homebrew. I seem to be able to restart my local server ...

$ brew services restart postgresql@14
Stopping `postgresql@14`... (might take a while)
==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14)
==> Successfully started `postgresql@14` (label: homebrew.mxcl.postgresql@14)

but whenever I try and connect, I repeatedly get this error

$ psql -Upostgres
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

What is the proper way to connect via psql to PostGres 14 on Mac OS Big Sur?

Dave
  • 753
  • 10
  • 22
  • 39

1 Answers1

0

You're probably getting a 'read the docs' downvote, but I'll jump in as we've all been there.

Your error is simple. There needs to be a space between the -U flag and the username.

If this is a vanilla install just typing psql should get you access to the database.

psql doc

Gurmokh
  • 176
  • 1
  • 9