HomeBrew How To Install PostgreSQL

Do you like this?

This short post shows you the steps to set up PostgreSQL using Brew on Mac OS.


1) Brew Install

brew install postgresql (or brew install postgresql8)
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
brew install postgresql8
ln -sfv /usr/local/opt/postgresql8/*.plist ~/Library/LaunchAgents
2) Set up Database
initdb /usr/local/pgsql/data
3) Connect on Console
4) Default Username and Password: It will be the same as your current login ID on your Mac computer. If you want to change this default behaviour, you can add a new user for your Mac OS and then chown for the directory /usr/local/pgsql/data

5) Start the server
postgres -D /usr/local/pgsql/data

comments powered by Disqus