Install PostgreSQL via brew under Mac

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.