Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql server在OS X Yosemite升级、自制后将无法启动_Postgresql_Homebrew_Osx Yosemite - Fatal编程技术网

Postgresql server在OS X Yosemite升级、自制后将无法启动

Postgresql server在OS X Yosemite升级、自制后将无法启动,postgresql,homebrew,osx-yosemite,Postgresql,Homebrew,Osx Yosemite,重新创建错误的步骤: brew卸载postgresql brew prune 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"? 我尝试

重新创建错误的步骤:

  • brew卸载postgresql
  • brew prune
  • 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"?
我尝试过的不起作用的建议修复:

  • sudo mkdir/var/pgsql\u socket/
  • sudo ln-s/private/tmp/.s.PGSQL.5432/var/PGSQL\u socket/
删除postmaster.pid文件(与上面的链接相同):

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

  • mkdir-p/usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/
    touch/usr/local/var/postgres/{pg_tblspc,pg_two phase,pg_stat_tmp}/.保持

编辑1:

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


/usr/local/ceral/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

我希望这能有所帮助。

我在约塞米蒂也遇到了类似的问题,但是通读您的描述,我怀疑当您运行start命令时,您忽略了复制以postgres结尾的命令的最后一个字符,例如
postgres-D/usr/local/var/postgres
,并不知何故创建了一个无关的
postgres
。这个post解决方案对我很有用
https://medium.com/@bitadj/complete-uninstall-and-reinstall-psql-on-osx-551390904b86
在尝试从原始数据备份还原时,我在Windows上遇到了类似的问题。你的解决方案对我有效。对我也有效(使用Mac OSX Catalina、自制和Postgresql 12.3)。有几个额外的文件夹和文件要添加,但想法相同。