# Psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory

**URL:** <https://forum.devtalk.com/t/psql-error-connection-to-server-on-socket-tmp-s-pgsql-5432-failed-no-such-file-or-directory/174136>\
**Category:** Backend Questions/Help\
**Tags:** rails, macos, postgresql\
**Created:** [17 October 2024 02:02 UTC](https://forum.devtalk.com/t/psql-error-connection-to-server-on-socket-tmp-s-pgsql-5432-failed-no-such-file-or-directory/174136 "2024-10-17T02:02:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.devtalk.com/user_avatar/forum.devtalk.com/astonj/32/7_2.png) [@AstonJ](https://forum.devtalk.com/u/AstonJ)\
**Post date:** [17 October 2024 02:02 UTC](https://forum.devtalk.com/t/psql-error-connection-to-server-on-socket-tmp-s-pgsql-5432-failed-no-such-file-or-directory/174136/1 "2024-10-17T02:02:15Z")

</div>

If you’re getting errors like this:

> psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory

See post below!

---

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.devtalk.com/user_avatar/forum.devtalk.com/astonj/32/7_2.png) [@AstonJ](https://forum.devtalk.com/u/AstonJ)\
**Post date:** [17 October 2024 02:03 UTC](https://forum.devtalk.com/t/psql-error-connection-to-server-on-socket-tmp-s-pgsql-5432-failed-no-such-file-or-directory/174136/2 "2024-10-17T02:03:48Z")

</div>

If you’ve tried the usual of:

```plaintext
$ brew services stop postgresql
$ rm /usr/local/var/postgres/postmaster.pid 
$ brew services start postgresql # Or: brew services restart postgresql

```

…and banged your head a lot, you may find it’s your Mac! Go to:

> System Settings \> General \> Login Items and Extensions \> Allow in the Background

To check if you have postgres listed and that it is on!

And if your system is a bit messed up (like mine, thank you Apple!) you may even have TWO!!! BOTH of these must be ON!!

 ![Screenshot 2024-10-17 at 02.57.54](https://forum.devtalk.com/uploads/default/original/2X/8/88e0ddfaac40702cd5c4b4850dcba76ef3fed1a6.png)

Hope this helps someone! :lol:
