LoginSignup
8
9

More than 5 years have passed since last update.

HomebrewでPostgresqlをインストール(MacOS 10.8)

Posted at

インストール

  • brew install postgresqlを実行。ちょっと時間がかかる
  • いろいろメッセージが出ています。うっかり消してしまっても、brew info postgresqlを実行すれば、表示出来るので、ご安心

初期化

  • initdb /usr/local/var/postgresを実行し、DB初期化する

ログイン時自動起動するように設定

  • ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
  • すぐ起動したい場合は、下記コマンドで起動

    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

確認

  • psql -lでデータベース情報が表示されればOK
                              List of databases
   Name    | Owner | Encoding |   Collate   |    Ctype    | Access privileges
-----------+-------+----------+-------------+-------------+-------------------
 postgres  | ***   | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 |
 template0 | ***   | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/***           +
           |       |          |             |             | ***=CTc/***
 template1 | ***   | UTF8     | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/***           +
           |       |          |             |             | **8=CTc/***
(3 rows)

補足:***はユーザ名です。
8
9
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
8
9