【发布时间】:2015-06-27 14:43:37
【问题描述】:
我有一个 Postgres 权限问题,每次我 brew install postgres 时,它都会以 root 用户身份执行,导致initdb、createdb 和或我尝试的其他任何东西的权限被拒绝。
我 sudo chown 拥有 /usr/local/var/postgres 的所有权,它似乎发生了变化,并允许我从 cmd 行手动进入目录,该目录仅包含一个列出错误的 server.log 文件:
postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": No such file or directory
然后我转到initdb 并返回:
The files belonging to this database system will be owned by user "jamesbkemp".
This user must also own the server process.
The database cluster will be initialized with locale "en_GB.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres"
然后我返回查看/usr/local/var/postgres,并且所有者已更改回root。经过几个小时的了解,我真的很茫然。大家有什么想法吗?
【问题讨论】:
标签: ruby database postgresql rvm homebrew