You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac OS下如何停止本地Postgres服务(Docker服务正常运行)

停止本地Postgres服务的操作方法

根据不同操作系统,停止本地Postgres服务的命令和步骤如下:

Linux 系统

使用 systemd(主流发行版如Ubuntu、CentOS 7+)

  • (可选)先确认服务状态:
    sudo systemctl status postgresql
    
  • 停止服务:
    sudo systemctl stop postgresql
    
  • (可选)禁止开机自动启动:
    sudo systemctl disable postgresql
    

如果你的Postgres是指定版本的集群(如postgresql@14-main),替换命令中的服务名即可,比如sudo systemctl stop postgresql@14-main

使用 init.d(旧版发行版)

  • 停止服务:
    sudo /etc/init.d/postgresql stop
    

macOS 系统

Homebrew 安装的Postgres

  • 停止服务:
    brew services stop postgresql
    
  • (可选)查看服务状态:
    brew services list
    

Postgres.app 安装的Postgres

  • 点击菜单栏中的Postgres图标,选择「Stop」;或者打开Postgres应用界面,直接点击停止按钮。

Windows 系统

通过图形界面

  1. 按下 Win + R,输入 services.msc 打开服务管理器
  2. 在列表中找到Postgres服务(名称通常为 postgresql-x64-xx,xx 对应你的Postgres版本号)
  3. 右键点击服务,选择「停止」

通过命令提示符(需管理员权限)

net stop postgresql-x64-xx

将命令中的xx替换为你的Postgres实际版本号

内容的提问来源于stack exchange,提问作者Sairam Gourishetty

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 16:18:20