Created
November 3, 2013 21:22
-
-
Save behboud/7294978 to your computer and use it in GitHub Desktop.
mac postgresql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initdb /usr/local/var/postgres -E utf8 # create a database cluster | |
postgres -D /usr/local/var/postgres # serve that database | |
PGDATA=/usr/local/var/postgres postgres # …alternatively | |
postgres -D /usr/local/var/postgres | |
postgres -D /usr/local/var/postgres | |
or | |
pg_ctl -D /usr/local/var/postgres -l logfile start | |
To have launchd start postgresql at login: | |
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents | |
Then to load postgresql now: | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
Or, if you don't want/need launchctl, you can just run: | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment