【发布时间】:2021-10-04 09:33:27
【问题描述】:
我正在尝试执行的命令:
pg_ctl init -D <path-to-db>
它给我的错误:
The files belonging to this database system will be owned by user "aashishgangwani".
This user must also own the server process.
initdb: error: file "/opt/homebrew/Cellar/libpq/13.3/share/postgresql/postgres.bki" does not exist
This might mean you have a corrupted installation or identified
the wrong directory with the invocation option -L.
pg_ctl: database system initialization failed
当尝试“which postgresql”和“where postgresql”时,它会在此处给出“未找到”:
(base) aashishgangwani@Aashishs-MacBook-Pro ~ % which postgresql
postgresql not found
(base) aashishgangwani@Aashishs-MacBook-Pro ~ % where postgresql
postgresql not found
更新:我尝试过 brew reinstall postgres 它不起作用
【问题讨论】:
-
在正常安装中,没有名为“postgresql”的可执行文件,因此它不在您的 PATH 中与您的问题无关。您的系统上是否有名为“postgres.bki”的文件?
-
@jjanes 是的,我确实在 /opt/homebrew/Cellar/postgresql/13.3/share/postgresql/postgres.bki 中找到了它,然后我将整个 postgres 文件夹复制粘贴到 libpq 目录中(/opt /homebrew/Cellar/libpq/13.3/share/) 所以我现在一切正常。
标签: postgresql macos homebrew