The Homebrew install command will install the basic Xcode Command Line Tools that it needs. However, I recommend the full install, especially if you’re running Catalina. To do this, you can run the following command from the Terminal. Xcode-select -install Install Homebrew. The following command will install Homebrew. Installation with Homebrew is simple if you’re only planning to use Ruby for Jekyll. Install with a version manager such as asdf, chruby, rbenv, or rvm if you need to switch among Ruby versions (instructions for rbenv are below). See the guide Install Ruby on Mac for details and recommendations. Install HomeBrew; Just copy and paste the line below in a terminal, and press enter. QGIS cannot be opened on Mac OS Catalina (QGIS is not notarized) Then you need to right-click on open. Homebrew’s package index.
In this tutorial we will learn to install PostgreSQL database on Mac using Homebrew.
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.
In Terminal run the following command to install PostgreSQL on Mac using Homebrew.
We can check the version of PostgreSQL using the psql
command.
To start PostgreSQL run the following command in the Terminal.
We will get a similar output shown below.
To stop PostgreSQL run the following command in the Terminal.
We will get a similar output.
To restart PostgreSQL run the following command in the Terminal.
We will get a similar output as shown below.
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.
To list all the users we use the du
command.
To list all the databases run the l
command.
To create a database run the following command. In the given example mydb is the name of the database.
To connect to a database use the c
command.
To list all the tables inside a database we run the d
command.
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.
In the following example we are creating a simple users table.
Now if we list the tables using the d
command we will get the table.
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 :-)