Start postgresql on mac

Source: Internet
Author: User
Start postgresql on mac and use brew to install postgresql. 1brewinstallpostgresql then creates a working directory and grants permissions accordingly. 1mkdir-pusrlocalvarpostgres initializes the database file. 1initdbusrlocalvarpostgresdata: Create a log directory. 1mkdir-pusrlocalvar

Start postgresql on mac and use brew to install postgresql. 1 brew install postgresql, create a working directory, and grant permissions accordingly. 1 mkdir-p/usr/local/var/postgres initialize the database file. 1 initdb/usr/local/var/postgres/data to create the log directory. 1 mkdir-p/usr/local/var

Start postgresql on mac

Use brew to install postgresql.

1

Brew install postgresql

Create a working directory and grant permissions accordingly.

1

Mkdir-p/usr/local/var/postgres

Initialize database files.

1

Initdb/usr/local/var/postgres/data

Create a log directory.

1

Mkdir-p/usr/local/var/log/postgres

Specify log output and start.

1

Pg_ctl start-D/usr/local/var/S/data-l/usr/local/var/log/S/log. log

If it is stopped, replace start with stop. If you do not want to specify a data directory every time, you can create an environment variable PGDATA that saves the address.

1

Export PGDATA =/usr/local/var/postgres/data

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.