gpt4 book ai didi

控制台每 10 秒出现一次 postgresql 错误

转载 作者:行者123 更新时间:2023-11-29 11:43:32 25 4
gpt4 key购买 nike

我在尝试学习 Rails 时安装了 postgresql-9.1。当时我没有遇到任何问题,但我只是打开我的 Console.app 来解决其他问题,我看到以下错误每 10 秒重复一次:

3/1/13 10:28:15 AM  com.edb.launchd.postgresql-9.1[89003]   2013-03-01 15:28:15 GMT FATAL:  data directory "/Library/PostgreSQL/9.1/data" has wrong ownership
3/1/13 10:28:15 AM com.edb.launchd.postgresql-9.1[89003] 2013-03-01 15:28:15 GMT HINT: The server must be started by the user that owns the data directory.
3/1/13 10:28:15 AM com.apple.launchd[1] (com.edb.launchd.postgresql-9.1[89003]) Exited with exit code: 1
3/1/13 10:28:15 AM com.apple.launchd[1] (com.edb.launchd.postgresql-9.1) Throttling respawn: Will start in 10 seconds

我怎样才能阻止它?

最佳答案

看起来您安装了 EnterpriseDB 的 PostgreSQL 包,但您不能使用它,因为服务器无法启动。我假设您正在使用其他一些 PostgreSQL 服务器(如 Postgres.app 或 Homebrew Postgres)进行开发工作?

如果是这样,请考虑只卸载未使用的 EnterpriseDB PostgreSQL 包。或者,您可以删除它的 launchd 配置文件,这样 launchd 就不会尝试启动它,但这可能会在以后造成更多困惑。

如果你想使用它,你需要修复权限。 “启动服务器的用户”不会是您的用户名,而是名为 postgrespostgres_ 的用户(在某些 Mac 系统上)。您可以通过阅读 EDB PostgreSQL 的 launchd 文件来找出是哪个。然后你需要:

sudo chown -R postgres /Library/PostgreSQL/9.1/data

(或 postgres_ 取决于 launchd 的预期)。

如果您正在运行另一个 PostgreSQL 服务器,这可能会允许 EDB 服务器尝试启动,但它会与您的其他 PostgreSQL 使用的端口号冲突,因此它仍然会失败。或者它可能会在您的计算机下次启动时成功启动,您将无法再访问其他 PostgreSQL 实例。因此,如果您已经在使用另一个版本的 PostgreSQL,您可能应该只卸载这个版本。

关于控制台每 10 秒出现一次 postgresql 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15166880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com