Mac Install Homebrew Catalina


  • Make sure to check out Part One, How To Install Apache on macOS 10.15 Catalina Using Homebrew, which is a pre-requisite for this piece. In the past, I used to rely on the version of Apache and PHP that came pre-loaded with the OS on my MacBook Pro. I would then install the PHP extensions I needed (Xdebug, Redis, etc.) from Homebrew.
  • Installing Homebrew. First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source. Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes. Open Terminal and run the following command.

Installing MongoDB on Mac (Catalina and non-Catalina) 14th Feb 2020. I had to reconfigure my Macbook after sending it for repairs. During the reconfiguration period, I noticed the instructions I linked to in “Setting up a local MongoDB connection” were outdated. Step 2: Install Node. By installing NodeJS you will also get NPM which is Node package manager. It will help you to install other packages. To install Node on your Mac using Homebrew type the following command. $ brew install node. Once you have Node installed you can check its version by typing the following command in the terminal.

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.

You can visit Homebrew official website https://brew.sh to learn more about it.

Once you have Homebrew (a.k.a. brew) installed on your machine you can run the following command in the Terminal to check the version.

To update run the following command.

Alright, time to install PostgreSQL on Mac.

Install PostgreSQL using Homebrew

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

We can check the version of PostgreSQL using the psql command.

Start PostgreSQL

Install Homebrew Mac Os Catalina

To start PostgreSQL run the following command in the Terminal.

Catalina

We will get a similar output shown below.

Stop PostgreSQL

To stop PostgreSQL run the following command in the Terminal.

We will get a similar output.

Restart PostgreSQL

To restart PostgreSQL run the following command in the Terminal.

We will get a similar output as shown below.

Mac Install Homebrew Catalina

Login to PostgreSQL database

By default we will get a database by the name postgres. So, to connect to it we will run the following command.

We will see the following output.

List all the users

To list all the users we use the du command.

List all the databases

To list all the databases run the l command.

Create a database

Mac Install Homebrew Catalina

To create a database run the following command. In the given example mydb is the name of the database.

Connect to a database

To connect to a database use the c command.

How To Install Homebrew On Macos Catalina

List all the tables inside a database

To list all the tables inside a database we run the d command.

Install Homebrew Mac Os X Catalina

Note! If there is no table then we will get a prompt stating no relations found.

Let us go ahead and create a simple users table inside the mydb database and try the above command again.

Create table

In the following example we are creating a simple users table.

Mac install homebrew catalina download

Now if we list the tables using the d command we will get the table.

How to exit from psql?

To exit or quit from psql type the q command.

Alright, this brings us to the end of this tutorial. Hope you found it useful. Please share this tutorial if it was helpful. See you in the next tutorial. Have fun developing :-)