Could not connect to Postgresql on Mac OS X after Installation <p>So I installed Postgresql onto my Mac and whenever I run anything like <code>psql</code> or <code>createdb cool_database_name</code> I get the following error.</p> <pre><code>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"? </code></pre> <p>So I follow along the different solutions. I reinstall postgresql to no avail. I go to postgresql.conf` and change it to </p> <pre><code>#port = 5432 # (change requires restart) #max_connections = 20 # (change requires restart) # Note: Increasing max_connections costs ~400 bytes of shared memory per # connection slot, plus lock space (see max_locks_per_transaction). #superuser_reserved_connections = 3 # (change requires restart) #unix_socket_directory = '/var/pgsql_socket' # (change requires restart) #unix_socket_group = '' # (change requires restart) #unix_socket_permissions = 0777 # begin with 0 to use octal notation </code></pre> <p>yet still nothing. I run commands such as </p> <pre><code>ls -lA /var/run/postgresql </code></pre> <p>Which tell me the file or directory does not exist.</p> <p>I also check into the <code>pg_hba.conf</code> file but everything looks ok</p> <pre><code># "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust # Allow replication connections from localhost, by a user with the # replication privilege. #local replication jason trust #host replication jason 127.0.0.1/32 trust #host replication jason ::1/128 trust </code></pre> <p>When I run <code>psql -h localhost</code> I get</p> <pre><code>psql: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (fe80::1) and accepting TCP/IP connections on port 5432? </code></pre> <p>I'm at a lost as to how to fix this. Any help would be appreciated. </p>