mac homebrew postgresql 服务异常中断

当遇到Mac上的Homebrew PostgreSQL服务异常中断时,可以尝试断开连接,删除/usr/local/var/postgres中的postmaster.pid文件,确认其已被删除,然后重新启动服务。此过程有助于解决服务无法启动的问题。
摘要由CSDN通过智能技术生成

 

1. 断开连接

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

 

// 9.6 
brew services stop postgresql
 

 

 

2. 删除/usr/local/var/postgres中的postmaster.pid

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

 

 

3. 查看是否删除postmaster.pid

ls /usr/local/var/postgres

 

 

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

    /usr/local/Cellar/postgresql/9.4.4/homebrew.mxcl.postgresql.plist: Could not find specified service

   

// 9.6
brew services start postgresql
 

 

 

4. 重新启动

 launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

 

// 9.6 
brew services start postgresql

 

 

 

一键复制

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm /usr/local/var/postgres/postmaster.pid
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  

 

// 9.6  
brew services stop postgresql
rm /usr/local/var/postgres/postmaster.pid
brew services start postgresql 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值