Friday, November 8, 2019

How to install PostgreSQL on Mac using Homebrew

Click the link: "How to install PostgreSQL on Mac using Homebrew"

In this tutorial we will learn to install PostgreSQL database on Mac using Homebrew.

Prerequisite

It is assumed that you have Homebrew installed on your Mac.
If you don't have Homebrew installed on your Mac then open Terminal and run the following command.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Alright, time to install PostgreSQL on Mac.

Install PostgreSQL using Homebrew

In Terminal run the following command to install PostgreSQL on Mac using Homebrew.
$ brew install postgres

Start PostgreSQL

To start PostgreSQL run the following command in the Terminal.
$ brew services start postgres

Stop PostgreSQL

To stop PostgreSQL run the following command in the Terminal.
$ brew services stop postgres

Restart PostgreSQL

To restart PostgreSQL run the following command in the Terminal.
$ brew services restart postgres

Read more...