簡體   English   中英

無法在 mac 上重新安裝 postgressql

[英]Unable to reinstall postgressql on mac

我正在嘗試重置 postgresql 但看起來好像卡在帶有密碼的 mac m1 上,並且每次我卸載並重新安裝時都會記住密碼。

所以當我運行brew uninstall postgresql然后 'brew install postgresql' 並沒有解決問題。

我試圖刪除/tmp/.s.PGSQL但看起來更糟,因為現在即使在重新安裝時也找不到這個文件。

那么從mac m1中完全刪除PostgreSQL然后從0重新安裝的正確方法是什么。

您需要運行的冷杉:

$ brew uninstall postgres
$ rm -rf /usr/local/var/postgres
$ rm /usr/local/var/log/postgres.log
$ rm -f ~/.psqlrc ~/.psql_history

如果你想確保沒有其他 Postgres-adjacent Homebrew 公式仍然安裝,你可以通過以下方式檢查:

$ brew list --formula | grep -e postgres -e psql

或在整個系統中搜索文件名匹配項:

$ sudo find / -name "*postgres*" -o -name "*psql*"

然后可以繼續重裝postgreSQL..

來源: https://blog.testdouble.com/posts/2021-01-28-how-to-completely-uninstall-homebrew-postgres/

免責聲明:確保備份您的數據庫以備日后需要,因為運行這些命令將刪除所有本地 Postgres 數據庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM