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?

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.