数据目录“ / usr / local / var / postgres”;所有权有误 [英] data directory "/usr/local/var/postgres" has wrong ownership
本文介绍了数据目录“ / usr / local / var / postgres”;所有权有误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在终端中放置 postgres -D / usr / local / var / postgres
时,我会得到以下提示:
When I put postgres -D /usr/local/var/postgres
in terminal, I get this back:
FATAL:数据目录 / usr / local / var / postgres具有错误的所有权
提示:服务器必须由拥有数据目录的用户启动。
FATAL: data directory "/usr/local/var/postgres" has wrong ownership HINT: The server must be started by the user that owns the data directory.
我该如何解决?
谢谢〜
How could I fix with that? Thanks~
推荐答案
通过执行操作检查该目录的所有者
Check the what the owner is of that dir by doing
ls -l /usr/local/var/ | grep postgres
您应该看到类似
-rw-r--r-- 1 postgresuser postgresuser 285659 Sep 1 18:05 postgres
假定它是 postgresuser,然后使用
Assuming it's "postgresuser", then run your database with
sudo -u postgresuser postgres -D /usr/local/var/postgres
这篇关于数据目录“ / usr / local / var / postgres”;所有权有误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文