在mac上安裝postgres數據庫

在mac上安裝postgres數據庫

  1. Install Homebrew
  2. brew install postgres
  3. initdb /usr/local/var/postgres
  4. 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
  5. /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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章