Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql #164

Open
yongheng2016 opened this issue Sep 18, 2023 · 0 comments
Open

postgresql #164

yongheng2016 opened this issue Sep 18, 2023 · 0 comments

Comments

@yongheng2016
Copy link
Owner

yongheng2016 commented Sep 18, 2023

卸载已安装的PostgreSQL

  1. 打开终端(Terminal)应用程序。
  2. 在终端中输入以下命令并按回车键:
    sudo /Library/PostgreSQL/16/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh
    
  3. 终端会提示您输入管理员密码,输入密码并按回车键。
  4. 接下来会显示一些卸载选项,请根据您的需要进行选择。
  5. 等待卸载程序完成,这可能需要一些时间。
  6. 卸载完成后,您可以通过在终端中输入以下命令来确认PostgreSQL是否已完全卸载:
    which psql
    
    如果该命令未返回任何路径,则表示PostgreSQL已成功卸载。

卸载postgresql 时候,遇到问题:
The data directory (/Library/PostgreSQL/16/data) and service user account (postgres) have not been removed.

  1. 打开终端应用程序。

  2. 运行以下命令以停止 PostgreSQL 服务:

    sudo launchctl unload -w /Library/LaunchDaemons/org.postgresql.postgres.plist
    
  3. 运行以下命令以删除 PostgreSQL:

    sudo rm -rf /Library/PostgreSQL
    
  4. 最后,运行以下命令以删除 PostgreSQL 用户:

    sudo dscl . delete /Users/postgres
    

完成后,您应该已经成功删除了 PostgreSQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant