PG Error could not connect to server: Connection refused Is the server running on port 5432?

前端 未结 2 1016
小蘑菇
小蘑菇 2020-12-28 23:22

I recently updated my machine (MacBook Pro running Mountain Lion) and ever since then, whenever I set up a rails project, my machine craps out and cannot connect to PG. Curr

2条回答
  •  情歌与酒
    2020-12-29 00:13

    This is quite easy than your think because If you update your mac then process is running but postmaster.pid file is missing from /usr/local/var/postgres/ here. so you need to start process for postgres which create postmaster.pid.

    If progress is running then -

    Stop manually:

    pg_ctl -D /usr/local/var/postgres stop -s -m fast
    

    Start manually:

    pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    

    now all are working...

提交回复
热议问题