首页 > 解决方案 > Completely remove postgres after brew uninstall OSX

问题描述

I would like to know how to completely remove PostgreSQL on macOS Sierra (10.13.6). I've used this command line:

brew uninstall postgres

But when I reinstall with brew install postgres I have the old config & content. I would like to make fresh install.

标签: postgresqlmacoshomebrew

解决方案


完全重新安装 postgresql 最初运行 brew doctorbrew update

现在通过运行卸载 postgresql

brew uninstall postgresql
rm -rf /usr/local/var/postgres
rm -rf .psql_history .psqlrc .psql.local .pgpass .psqlrc.local

现在重新安装 postgresql 不会带回以前的配置和内容


推荐阅读