Answer the question
In order to leave comments, you need to log in
Postgresql won't start on debian. How to start?
Hello.
I'm trying to install and run postgresql on debian wheezy but nothing comes up.
I am installing from the official wheezy repository. sudo apt-get install postgresql postgresql-contrib
Ideally, postgres should start immediately after installation, but this does not happen:
[warn] No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).
Setting up postgresql-9.6 (9.6.2-1.pgdg70+1) ...
Creating new cluster 9.6/main ...
config /etc/postgresql/9.6/main
data /var/lib/postgresql/9.6/main
locale en_US.UTF-8
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.6/main"
Error: initdb failed
Error: could not create default cluster. Please create it manually with
pg_createcluster 9.6 main --start
or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.6/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
[warn] No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).
Answer the question
In order to leave comments, you need to log in
try:
root#rm -rf /var/lib/postgresql/9.6/main/*
root#chown postgres.postgres /var/lib/postgresql/9.6/main
root#chmod 700 /var/lib/postgresql/9.6/main
root#su postgres
postgres$initdb -D /var/lib/postgresql/9.6/main
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question