【问题标题】:Postgres does not worksPostgres 不工作
【发布时间】:2018-04-08 05:53:18
【问题描述】:

postgres.app 不起作用,安装后我尝试启动服务器,返回此错误:

无法启动 PostgreSQL 服务器。

pg_ctl: 无法启动服务器

检查日志输出。

这是日志:

2017-10-26 20:09:45.136 CEST [592] 日志:无法将主机名“localhost”、服务“5432”转换为地址:提供节点名或服务名,或未知

2017-10-26 20:09:45.136 CEST [592] 警告:无法为“localhost”创建监听套接字

2017-10-26 20:09:45.136 CEST [592] 致命:无法创建任何 TCP/IP 套接字

2017-10-26 20:09:45.137 CEST [592] 日志:数据库系统已关闭

在 MAMP 上运行同样的问题。 我正在使用 MacOSX Sierra 10.12.6

【问题讨论】:

  • 查看您的文件/etc/hosts。它应该有一个条目127.0.0.1. localhost。如果没有,请使用sudo 和您选择的编辑器添加这样一行。

标签: macos postgresql sockets localhost mamp


【解决方案1】:

您的主机文件中没有 localhost 条目

C:\Windows\System32\Drivers\etc\hosts

或者其他应用已经在使用端口 5432

在 Mac 中

/private/etc/hosts

https://www.tekrevue.com/tip/edit-hosts-file-mac-os-x/

【讨论】:

  • 嗯...C:\Windows 在 Mac 上是一件很糟糕的事情。
猜你喜欢
  • 2013-07-31
  • 1970-01-01
  • 1970-01-01
  • 2015-05-16
  • 2016-06-06
  • 2022-01-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多