psql: could not connect to server: No such file or directoryIs the server running locally and accepting
- 用brew卸载postgresql:
brew uninstall postgresql
brew doctor
(修正这里的一切)brew prune
删除所有Postgres文件夹:
rm -r /usr/local/var/postgres
rm -r /Users/<username>/Library/Application\ Support/Postgres
用brew重新安装postgresql:
brew install postgresql
- 启动服务器:
brew services start postgresql
重新运行 psql postgres 没有错误