Mac 运行 psql postgres 报错

psql: could not connect to server: No such file or directory
 Is 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  没有错误

猜你喜欢

转载自blog.csdn.net/james_laughing/article/details/79542631