Reputation: 3726
I'm trying to run Django's syncdb operation and am getting the following error:
psycopg2.OperationalError: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
I've read the answers to this question and have tried the following:
(I restarted the postgresql server after each step.)
I've also checked my pg_hba.conf file to see if the Unix domain socket was accepting connections from all users (based on this page). Here's what I have there:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
I never had this problem before. I somewhat recently upgraded to Lion and am working on a new virtualenv with the bare minimum of modules installed.
Upvotes: 0
Views: 1014
Reputation: 3726
Found the answer courtesy of Bradley Ayers:
Upvotes: 1
Reputation: 3865
your database is not running try
pg_ctl -D /usr/local/var/postgres start
assuming thats where your postgre data directory is
Upvotes: 0