Postgres.app Could not start on port 5432

后端 未结 24 1044
暗喜
暗喜 2021-01-29 22:24

I\'m using http://postgresapp.com. In the menubar it gives the error \" Could not start on port 5432.\" Similarly if I try to start the server from the terminal, I get:

24条回答
  •  有刺的猬
    2021-01-29 23:07

    I was just having this exact issue. When I ran which psql it was pointing at the Postgres client tools installed with Lion:

    /usr/bin/psql

    Using a hint from Frank Wiles I ran ps auxw | grep post to confirm that postgres was running and that it was running on the right port, that also showed me the postgres.app path:

    /Applications/Postgres.app/Contents/MacOS/bin/postgres.

    So I edited by .bash_profile to export that directory. On first effort I added it to the end of the path. When I ran echo $PATH I could see that usr/bin was the first thing in the path, and which psql still gave the /usr/bin path. At that point a friend guided me in the right direction:

    export PATH="/Applications/Postgres.app/Contents/MacOS/bin:${PATH}"

    Start a new terminal window, then run which psql -- it should point to the postgres.app location and psql should fire up the postgres shell. Works fine now.

提交回复
热议问题