Install Postgrep under Mac. Easy installation using the Brew Package management tool
Brew is the Homebrew installation method
Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
Mac OS x already comes with Ruby
After you have finished installing brew. Installing PostgreSQL with Brew
Brew Install Postgrepsql
Installation is complete See the PostgreSQL software is installed to/usr/local/cellar/postgrepsql/9.4.3/and a link directory is established/usr/local/opt/postgresql
The installation finally automatically initializes a database path of/usr/local/val/postgres
Start PostgreSQL
pg_ctl-d/usr/local/var/postgres-l/usr/local/var/postgres/server.log Start
Stop PostgreSQL
pg_ctl-d/usr/local/var/postgres stop-s-M fast
Create a new database user
CreateUser Weixinadmin-p
Create a new database for this user
Createdb Weixindb-o weixinadmin-e utf8-e
Use this user to access the database
Psql-u weixinadmin-d weixndb-h 127.0.0.1
Install PostgreSQL via brew under Mac