The Simplest Way to Install SQL Server 2017 on macOS

This article we will show how to install Microsoft SQL Server 2017 on macOS, as we talk it in previous blog.

Which method we use?

Prior to SQL Server 2017, if we want to install it on macOS, a virtual machine (like Parallels Desktop) is essential. Then we can install a Windows system in it and then we install and run SQL Server.

Luckily, from SQL Server 2017, we can choose to install SQL Server on Docker containers.

How to install SQL Server on Docker?

1 What is Docker?

Docker is a platform which can make softwares to run in it. It is called a container, which is an isolated environment.

2 Download and install Docker

If you haven’t installed Docker on your Mac, the next step is to install Docker.

Go to Docker page to download the .dmg file and then double click and install it according to the instructions.

3 Run Docker and increase the memory

Run Docker as you used to run other softwares and the next step is to increase the memory. This is because the default value of Docker memory is 2 GB but SQL needs at least 3.25 GB.

I recommend we set the memory value to 4 GB.

  1. Click Docker icon on top menu of your Mac
  2. Click Preferences
  3. Set Memory under Advanced to 4 GB.

Click Apply&Restart

4 Download Microsoft SQL Server 2017

The next step is to download SQL Server 2017 from Terminal, which is an easy way.

Copy and paste the command in Terminal of your Mac:

docker pull microsoft/mssql-server-linux

Through it, the latest version of MS Server SQL can be downloaded.

5 Run a Docker image

Copy, change and paste the command in Terminal of your Mac:

docker run -d --name xxxxxxx -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=xxxx\xxxx' -p 1433:1433 microsoft/mssql-server-linux

We need to change the name and password as your own here.

This step is to run an instance of Docker image. A Docker image is a file, which is used to execute codes in a Docker container.

If you want to check, copy and paste the following command to see whether the Docker container is running:

docker ps

If it works, it will show like this:

6 Install the sql-cli command line tool

The next step is to install the sql-cli command line tool. It can allow you to run commands against your SQL Server instance.

Copy and paste the command in Terminal of your Mac:

npm install -g sql-cli

If an error happened and shows you do not have the permissions to access this file as the current user, just try add sudo in your command:

sudo npm install -g sql-cli

7 Connect to SQL Server

After sql-cli is installed, now we can connect to SQL Server using the mssql command.

mssql -u xxxxxxx -p xxxxxxx

Here xxxxxxx and xxxxxxx means your name and password.

Then you will see:


Now you’ve successfully connected to your instance of SQL Server.

Next blog we will continue our journey with SQL Server and Azure Data Studio. Maybe you will want to read more about Azure and Microsoft Learn in the previous blog.

If you are interested in or have any problems with Business Intelligence, feel free to contact me .

Or you can connect with me through my LinkedIn.

Welcome to SQL (SQL 101)

If you want to find a BI Analyst job in New Zealand, you may be not a master of Python, R, etc.

However, SQL knowledge is essential.

Here is a BI Analyst job advertisement on LinkedIn, which is a full-time role.

St John is also an accredited employer.

If you have a skill that is needed by a New Zealand accredited employer and they offer you full-time work when you are abroed, you may be able to get a Talent (Accredited Employer) Work Visa.

From the job description, we can find SQL knowledge is important.

What is SQL?

Firstly, I want to talk about Database(DB). We all know DB is a kind of software to store a large amount of data, mainly Relational DB.

Structured Query Language(SQL) is always linked with DB. SQL can be used to operate data, such as querying and updating.

The relationship between DB, data and SQL is like: DB is a plate, data is dishes on the plate and SQL is your fork.

Currently, most of the websites and Apps are based on SQL and DB.

There are several popular DB on the world, e.g., SQLite, MySQL, Postgres, Oracle and Microsoft SQL Server.

Among them, MSSQL Server is the most popular in New Zealand.

Luckily, all of them can support SQL although they have different characteristics.

It is like if you have the fork, you can operate dishes on different plates.

What is Relational DB?

A DB is composed of several tables (like tables in Excel) and tables are composed of rows and columns.

We can query and obtain some results from the DB through SQL language.

Maybe some people will be confused about: What is the difference between DB and Excel? Excel has already existed on the world, why SQL is created?

That is because DB = Tables + Relations between tables.

Tables in Excel can’t meet the data operating requirements in companies because of the complex relations between tables.

How to kick-start SQL?

After knowing the terms of SQL and Relational DB, the next step is to set up the environment with SQL Server, which we will talk in the next blog.

If you are interested in or have any problems with Business Intelligence, also feel free to contact me .

Or you can connect with me through my LinkedIn.

An Introduction To Microsoft Learn

In the beginning, I want to state some reasons why I want to keep writing as a blogger.

Because:

  1. I want to become a better writer.
  2. I feel like I have some professional things to talk about.
  3. I want a new challenge.

I want to improve my communication skills by making professional knowledge easier for readers to understand.

Because the most important thing in communication is not speaking, it is how other people can understand your words.

To achieve this goal, sometimes maybe I will need to sacrifice the accuracy of some information.

However, if the audience can accept some basic terms in the first place, I can express more precise concepts to them.

As a nearly graduate IT student, I feel that there is still a gap between what is learned in universities and the practical skills used in real world

Luckily, the Internet is convenient enough for us to find what we want to learn nowadays.

Practitioners in the IT industry are supposed to maintain the ability to life-long learning.

I have accumulated some self-learning experience, and I want to share some of the learning resources with you.

The official documents are highly recommended: They will provide the latest tutorials, then we can write a few demos to get started. 

Consequently, this blog I want to talk about is Microsoft Learn, a learning platform which provides me with the best experience. 


Microsoft Learn
 is a new learning platform created by Microsoft and it focuses on Azure.

Azure is not free.

Although we can sign up for a free trial account, we have to re-apply it after expiring, which is more troublesome. 

But Azure is widely used in New Zealand.

If you want to find an IT job in New Zealand, understanding and mastering Azure skills should be considered as the basic requirements in most cases.

However, an Azure subscription is indispensable. That’s why I highly recommend Microsoft Learn.

Because it provides free Azure subscriptions and an online Azure Lab in addition to general teaching tutorials.

It means that we can use Azure subscriptions for free, create resources, and use them during the course.

The subscription will be automatically released after a while, probably several hours.

If you haven’t finished, you can continue to learn by recreating another one, which is very convenient.

Once the sandbox is activated, we can use the Azure subscription, and the Azure Cloud Shell interface will appear on the right side of the browser. We can enter commands directly into the browser to operate Azure.

Every time I complete a course, I will get the corresponding badges and scores. I have already reached the 8th level !!

This learning experience seems to play games, and I can’t stop it!

If you are interested in or have any problems about Microsoft Azure, feel free to contact me .

Or you can connect with me through my LinkedIn.