> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# Postgres could not connect to server
- URL: https://til.codes/postgres-could-not-connect-to-server/
- Published: 2015-09-22T13:50:52.000Z
- Updated: 2015-09-22T13:50:52.000Z
- Author: Manu Ajith
- Tags: postgres, psql, postgresql, database, mac, osx, #Import 2024-07-13 21:01

```
$ psql
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

```

The reason for the issue is because a pid file was blocking postgres from starting up. To fix it:

```
rm /usr/local/var/postgres/postmaster.pid

```

and then all is well.