• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

普段はPostgresqlのサイトで配布されているMac用のインストーラを使っているのですが、どうやらLionはまだサポートされていないようです。

ということで、homebrewを使ってインストールすることにしました。

Homebrewをインストール

以下を実行すればok

pre>>
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
<<--

あとは

pre>>
brew install postgresql
<<--

でインストールし、以下でdbを初期化します。

pre>>
initdb /usr/local/var/postgres
<<--

最後に、自動起動の設定を行います。

pre>>
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
<<--

brewでインストールした場合、postgresユーザは作成されないようです。
$USERがスーパユーザとして作成されます。

posted by genki genki on Thu 18 Aug 2011 at 17:56 with 0 comments