1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Postgresql(11.1)をHomebrewで構築するときにエラー

Posted at

環境

MacOS sierra
Homebrew
PostgreSQL 11.0

エラー内容

Railsのアプリ作成中にpostgresqlをインストール。
データベースに繋がりませんでした。

Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

解決方法

エラーをググり、解決方法を試すもだめ。なんか雰囲気が違うので、エラーをしっかり読むことに。
あー、
brewがちゃんと教えてくれてました!

To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

既に私のMacにpostgresql(10.~)がインストール済みだったみたいで、
データベースのアップグレードが必要だったみたい。
言われたとおりに以下実行

brew postgresql-upgrade-database

ちゃんと接続できました。

psql -l
                        List of databases
Name    |  Owner  | Encoding |   Collate   |    Ctype    |  Access 

いろんな解決方法があるみたいですが、自分が探していたときにはこのやり方ありませんでした。
(そりゃこんなハマり方するやついないだろうってことなんでしょうが...)
自分の備忘録にとっておきます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?