4
1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make it clear SQL on Linux is not a “light” SQL version but Microsoft’s goal is a fully featured SQL Server. In this article I will explore the process to Install SQL on Linux on an on-premises lab. Install SQL on Linux - Supported Platforms Before exploring the actual installation instructions be aware SQL on Linux is supported on the following distributions 1. Red Hat Enterprise Linux 7.2 2. Ubuntu Linux 16.04 3. SUSE Linux Enterprise Server 12 SP2 (still not supported but will be soon so I’ve included it anyhow) There are other deployment options like running on Docker or an Azure Virtual machine but for this article I will use Ubuntu Linux 16.04 as I already have a VM running it. Deploying Ubuntu Server is a trivial process so I will not cover the OS installation steps here. Install SQL on Linux - Step by Step Connect to the Linux server where you will install SQL and issue the following command curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Install SQL on Linux - gallery.technet.microsoft.com · 1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make

  • Upload
    lyque

  • View
    237

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Install SQL on Linux - gallery.technet.microsoft.com · 1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make

1

Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux.

It is important to make it clear SQL on Linux is not a “light” SQL version but Microsoft’s goal

is a fully featured SQL Server.

In this article I will explore the process to Install SQL on Linux on an on-premises lab.

Install SQL on Linux - Supported Platforms

Before exploring the actual installation instructions be aware SQL on Linux is supported on

the following distributions

1. Red Hat Enterprise Linux 7.2

2. Ubuntu Linux 16.04

3. SUSE Linux Enterprise Server 12 SP2 (still not supported but will be soon so I’ve included

it anyhow)

There are other deployment options like running on Docker or an Azure Virtual machine but

for this article I will use Ubuntu Linux 16.04 as I already have a VM running it.

Deploying Ubuntu Server is a trivial process so I will not cover the OS installation steps here.

Install SQL on Linux - Step by Step

Connect to the Linux server where you will install SQL and issue the following command

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

Page 2: Install SQL on Linux - gallery.technet.microsoft.com · 1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make

2

This will install the Microsoft repository key in the local keyring so to trust the repository and

install software from it.

Next you need to register the repository so that the local system will know where to down-

load files from

curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list |

sudo tee /etc/apt/sources.list.d/mssql-server.list

Now rune the following command to refresh repository metadata

sudo apt-get update

Finally run the following command which will carry on SQL Server installation

sudo apt-get install -y mssql-server

Page 3: Install SQL on Linux - gallery.technet.microsoft.com · 1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make

3

The above screenshot is just partial as a lot of text will flow on the screen while necessary

packages are downloaded and installed, once everything has been correctly downloaded the

following success message will be displayed

As the instructed on screen run /opt/mssql/bin/sqlservr-setup command to start SQL Configu-

ration

You will be asked to insert sa password and configure services startup

That’s it! SQL is now installed on your Linux machine you can easily check if it is running via

the following command

Page 4: Install SQL on Linux - gallery.technet.microsoft.com · 1 Install SQL on Linux Microsoft recently made available SQL public preview of SQL Server for Linux. It is important to make

4

Of course if you prefer to use GUI tools here’s a screenshot from one of my lab machines

with SQL Management Studio installed and connected to Linux SQL Server

A big kudos to Microsoft for releasing SQL on Linux and making the installation a breeze!