简体   繁体   中英

Unable to install postgresql ubuntu with error initdb

I am using Ubuntu server. I am trying to install postgresql on it. when I try to start postgres using sudo service postgresql start it result me into

*No PostgreSQL clusters exist; see "man pg_createcluster"

and when I try to create cluster using command pg_createcluster --start 9.6 main (*9.6 is my postgres version)

The result is as follows

Creating new PostgreSQL cluster 9.6/main ...
/usr/lib/postgresql/9.6/bin/initdb -D /var/lib/postgresql/9.6/main -- 
auth-local peer --auth-host md5
initdb: could not look up effective user ID 108: Permission denied
Error: initdb failed

I am not able to figure out what is the issue please help.

It looks like your /etc/passwd is not readable. I'm not sure which distro would require it, but it is a problem for initdb .

I believe fast solution would be running as root chmod 644 /etc/passwd

And follow with

/usr/lib/postgresql/9.6/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM