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

前端 未结 2 1013
小蘑菇
小蘑菇 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:00

    Run in your command line

    postgres -D /usr/local/var/postgres
    

    If the result is like the next one

    LOG:  skipping missing configuration file "/usr/local/var/postgres/postgresql.auto.conf"
    FATAL:  database files are incompatible with server
    DETAIL:  The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.
    

    Run

    brew postgresql-upgrade-database
    

    Based in this post

提交回复
热议问题