簡體   English   中英

無法安裝PostgreSQL initdb錯誤

[英]Unable to install postgresql ubuntu with error initdb

我正在使用Ubuntu服務器。 我正在嘗試在上面安裝postgresql。 當我嘗試使用sudo service postgresql start它導致我進入

*No PostgreSQL clusters exist; see "man pg_createcluster"

當我嘗試使用命令pg_createcluster --start 9.6 main創建集群時pg_createcluster --start 9.6 main (* 9.6是我的postgres版本)

結果如下

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

我無法找出問題所在,請幫忙。

看來您的/etc/passwd不可讀。 我不確定哪個發行版會需要它,但這是initdb的問題。

我相信快速解決方案將以root chmod 644 /etc/passwd

並跟隨

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

命令

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM