SakuraWi - BLog

WEBエンジニア。聴いたお話をまとめておく倉庫的な。スタックストックスタック!

posgresqlが起動しない時の対処方法


下記エラーがでてうまく動かない時の対処方法

PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

結論

versionが10で古かったので、12にあげたら動きました。

xxxx [master=]$ postgres -D /usr/local/var/postgres
2020-07-05 20:51:03.344 JST [4538] FATAL:  database files are incompatible with server
2020-07-05 20:51:03.344 JST [4538] DETAIL:  The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 12.3.
brew postgresql-upgrade-database

直らない

rm /usr/local/var/postgres/postmaster.pid