Whenerver I start PostgreSQL using command:
$ sudo /etc/init.d/postgresql start
Pg doesn't start up. The error reported is:
* Starting PostgreSQL 8.4 database server
* The PostgreSQL server failed to start. Please check the log output:
2010-01-21 22:10:00 PST FATAL: private key file "server.key" has group or world access
2010-01-21 22:10:00 PST DETAIL: File must be owned by the database user or root, must have no write permission for "group", and must have no permissions for "other".
... and when I try to access psql
as the postgres
user with:
$ sudo su postgres
$ psql
it gives me an error:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
upstart
, but I'm not sure. Thanks for including the exact text of the error message. – Chookpsql
as userpostgres
. I prefersudo -u postgres psql
. – Chookserver.key
got there, what changed. I'm pretty sure @swair's answer has it right, so I'm mostly explaining for next time. – Chook