Homebrew is a great tool on Mac to install 3rd-party softwares and unix softwares like libxml2, MySQL, Redis, etc. Today let’s install PostgreSQL 9.4 with it.
-
First, install it with
Homebrewcommand:brew install homebrew/versions/postgresql94 -
And then, start
postgresqlservice with following command:brew services start homebrew/versions/postgresql94This command will make sure
postgresqlis running every time you restart your computer. If you just want to start it one time, you could try command:postgres -D /usr/local/var/postgres -
Last thing you need to do is to create a superuser
postgres:createuser -d -a -s -P postgresAfter entering your password, you have a running postgresql now.