在mac上安裝postgres數據庫
- Install Homebrew
- brew install postgres
- initdb /usr/local/var/postgres
- To start server at startup
- mkdir -p ~/Library/LaunchAgents
- ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
- launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist - /usr/local/Cellar/postgresql//bin/createuser -s postgres
Now, it is set up, login using psql -U postgres -h localhost or use PgAdmin for GUI.
By default user postgres will not have any login password.