gpt4 book ai didi

OS X Yosemite 升级后,Postgresql 服务器将无法启动, Homebrew 软件

转载 作者:行者123 更新时间:2023-11-29 11:57:00 24 4
gpt4 key购买 nike

重现错误的步骤:

  • brew uninstall postgresql
  • brew 西梅
  • brew 安装 postgresql
  • 运行 postgresql 启动命令
  • psql

产量:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

我尝试过但不起作用的建议修复:

create missing symbolic link:

  • sudo mkdir/var/pgsql_socket/
  • sudo ln -s/private/tmp/.s.PGSQL.5432/var/pgsql_socket/

删除 postmaster.pid 文件(与上面相同的链接):

  • rm/usr/local/var/postgres/postmaster.pid

create potentially "cleaned up" directories from upgrade:

  • mkdir -p/usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/
    触摸/usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/.keep

Related GitHub issue

编辑 1:

This article正确地推测有多个版本的 postgres 正在使用,并且必须指定哪个 pg_ctl(如下)。奇怪的是,/usr/local/var 中有两个目录:postgre & postgres。如果有人知道要更新哪些设置以直接使用正确的 pg_ctl 命令,我将不胜感激!

/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_ctl -D/usr/local/var/postgre start

最佳答案

我遇到了同样的问题,在查看日志文件后我发现缺少一个目录:

$ tail /usr/local/var/postgres/server.log
FATAL: could not open directory "pg_tblspc": No such file or directory

然后我做了$ mkdir/usr/local/var/postgres/pg_tblspc,重新启动了 PostgreSQL 并得到:

$ tail /usr/local/var/postgres/server.log
FATAL: could not open directory "pg_replslot": No such file or directory

多次重做该过程后,我创建了以下目录,然后成功启动了 PostgreSQL:

/usr/local/var/postgres/pg_tblspc
/usr/local/var/postgres/pg_replslot
/usr/local/var/postgres/pg_twophase
/usr/local/var/postgres/pg_logical
/usr/local/var/postgres/pg_logical/mappings

希望对您有所帮助。

关于OS X Yosemite 升级后,Postgresql 服务器将无法启动, Homebrew 软件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27071697/

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