【问题标题】:cannot restart postgres on mac os x [duplicate]无法在 mac os x 上重新启动 postgres [重复]
【发布时间】:2013-10-02 21:19:35
【问题描述】:

我无法在 Mac OS X 上重新启动 postgres 服务器。 我该如何解决这个问题?

尝试了两种方法:

pg_ctl 重启返回:

pg_ctl: PID file "usr/local/var/postgres:/postmaster.pid" does not exist
Is server running?
starting server anyway
pg_ctl: could not read file "usr/local/var/postgres:/postmaster.opts"

服务器没有重启

pg_ctl -D /usr/local/var/postgres 重启结果:

   pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist
   Is server running?
   starting server anyway
   server starting
   LOG:  could not bind IPv4 socket: Address already in use
   HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
   LOG:  could not bind IPv6 socket: Address already in use
   HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
   WARNING:  could not create listen socket for "*"
   FATAL:  could not create any TCP/IP sockets

【问题讨论】:

标签: macos postgresql


【解决方案1】:

1 - 您的data 目录可能有误。确保使用正确的路径。

2 - 如果安装多个 postgres,则需要指定使用哪个 pg_ctl

我手动安装了 postgres 9.2,下面是我的启动方式:

/Library/PostgreSQL/9.2/bin/pg_ctl -D /Library/PostgreSQL/9.2/data start

我通过 HomeBrew 安装了 postgres 9.1,它是如何开始的:

/usr/local/Cellar/postgresql/9.1.5/bin/pg_ctl -D /usr/local/var/postgres-9.1.5 start

【讨论】:

  • 但是需要postgresql用户权限才能运行第一个命令[如果手动安装]
猜你喜欢
  • 2019-05-20
  • 1970-01-01
  • 2012-12-21
  • 1970-01-01
  • 2011-07-20
  • 2014-09-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多