For instance, when I tried to run the South migrations for the Django project I'm working at, I got this:
How I fixed this?
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"?
- Edit PostgreSQL's config to define the unix_socket_directory setting:
$ sudo nano /Library/PostgreSQL/9.0/data/postgresql.conf
In my case I changed the setting to unix_socket_directory = '/var/pgsql_socket/'. - Exceute the following commands:
$ sudo dscl . append /Groups/_postgres GroupMembership postgres $ sudo chmod g+w,o+rx /var/pgsql_socket/
- Restart the server:
$ sudo -u postgres /Library/PostgreSQL/9.0/bin/pg_ctl -D /Library/PostgreSQL/9.0/data/ restart
alias restart_postgres='sudo -u postgres /Library/PostgreSQL/9.0/bin/pg_ctl -D /Library/PostgreSQL/9.0/data/ restart'
No hay comentarios:
Publicar un comentario