Install SQL Server on Ubuntu (Step-By-Step)

Installing SQL Server on Linux was a great experience for me, that I would like to share with you the challenges and some of the scripts. Hope you enjoy reading this blog post and it is informative for you.

Before we start, we do need to install the Ubuntu Server 16.04 version on either physical machine or virtual. I used Hyper-V to host the Linux OS but I found that VirtualBox works much better and smooth with Linux OS. So I suggest you to use VirtualBox to install SQL Server on Ubuntu.

[plain]I assume that you already installed Ubuntu Server 16.04 already.[/plain]

[plain]The Ubuntu Server needs to have internet connection all the time during installation.[/plain]

Install MSSQL-SERVER

Step 1: Enter sudo command to change the current user to SuperUser and install the Microsoft GPG Keys into the Ubuntu by the following script:

[plain]

curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add

[/plain]

step-1

Step 2: Register SQL Server repository into the Ubuntu by the following script.

[plain]curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list > /etc/apt/sources.list.d/mssql-server.list[/plain]

step-2

Step 3: Now its time to install SQL Server by using the following script. In some cases the following script does not run and throws an error regarding another process is using the path or variable, which you need to restart the Ubuntu.

[plain]

sudo apt-get update /*It updates the Microsoft SQL Server repository list, that imported into Ubuntu in the previous step.*/
sudo apt-get install mssql-server

[/plain]

step-3-1

As you see in the above output, it mentions that repository cannot be authenticated. You may ignore this error message.

step-3-2

Now, the SQL Server installation is done!

step-3-3

Step 4: Run the following script to configure the SQL Server instance in Ubuntu.

[plain]sudo /opt/mssql/bin/sqlservr-setup[/plain]

step-4

Install MSSQL-TOOLS

Step 1: Register the Microsoft SQL Server repository in Ubuntu by the following script.

[plain]curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/msprod.list[/plain]

step-5

Step 2: Run the following script to install the Microsoft SQL Server Tools in Ubuntu.

[plain]

sudo apt-get update /*It updates the Microsoft SQL Server repository list, that imported into Ubuntu in the previous step.*/
sudo apt-get install mssql-tools

[/plain]

step-6

Step 3: Once the packages are downloaded and installed, you are required to accept the license terms and conditions through the following prompt message boxes.

step-7

step-8

MSSQL-SERVER Service Verification

Now its time to verify, whether the SQL Server instance is running properly on Ubuntu or not, You may use the following script to verify the service.

[plain]systemctl status mssql-server[/plain]

sqllinux-14

Connecting to SQL Server

We are only able to connect to SQL Server instance in Ubuntu through SQLCMD tool, and you can able to connect to the database engine through SQL Server Management Studio on Windows platform.

SQLCMD

sqllinux-15

Share This Story

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Share Your Comments

About The Author

Search Articles

Categories

Follow Fard Solutions

Share Your Comments

Fard Solutions Sdn. Bhd. Company was established in 2012 in Kuala Lumpur. We are engaged in development, implementation, integration and maintenance of the most advanced database solutions and IT research & development (innovation).

(+60) 03 8994 6788

info@fard-solutions.com

Fard Technology Corp.
700-1199 West Hastings Street,
Vancouver, British Colombia,
V6E 3T5 Canada.

Fard Solutions Sdn. Bhd.
1-1C & 1-2C Incubator 1,
Technology Park Malaysia,
Bukit Jalil, 57000
Kuala Lumpur, Malaysia.

  • Copyrights © 2020 Fard Solutions Sdn. Bhd. , All rights reserved.
  • Privacy Policy
  • Terms of Service
  • A Project By Website Artisan