DEV Community

Cover image for Microsoft SQL Server 2017 on Debian 9
nabbisen
nabbisen

Posted on • Updated on • Originally published at scqr.net

Microsoft SQL Server 2017 on Debian 9

Introduction

Microsoft SQL Server is one of relational database management systems aka RDBMS.
It is available on Linux since SQL Server 2017 with both installation and Docker image.
This post shows how to install it on Debian 9 "stretch" (with VirtualBox).

Tutorial

This post is based on the official guidance.

Requirements

2GB RAM is absolutely required in order to run setup script after installing the package.
The others are here.

Preparation

sudo command is also necessary in running setup script.
Therefore, install it and set it up:

# apt-get install sudo
# visudo
Enter fullscreen mode Exit fullscreen mode

Install other packages necessary as preparation.

$ sudo apt-get install curl
Enter fullscreen mode Exit fullscreen mode

Add dependencies of mssql-server.
First, Install the security package:

$ sudo apt-get install apt-transport-https
Enter fullscreen mode Exit fullscreen mode

Next, install older libssl.
Edit /etc/apt/sources.list to add a line to the bottom like this:

+ deb http://ftp.debian.org/debian jessie main
Enter fullscreen mode Exit fullscreen mode

Then install it:

$ sudo apt-get update
$ sudo apt-get install libssl1.0
Enter fullscreen mode Exit fullscreen mode

Moreover, for the sake of apt-key add microsoft.asc:

$ sudo apt-get install gnupg
Enter fullscreen mode Exit fullscreen mode

Installation

Here we're ready.
Let's add the repository:

$ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
$ curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server.list
Enter fullscreen mode Exit fullscreen mode

Then install it:

$ sudo apt-get update
$ sudo apt-get install mssql-server
Enter fullscreen mode Exit fullscreen mode

Run the setup script:

$ sudo /opt/mssql/bin/mssql-conf setup
Enter fullscreen mode Exit fullscreen mode

You can follow the installer.
"Express" edition is free to use with limitations.

Finally, restart the service:

$ sudo systemctl restart mssql-server.service
Enter fullscreen mode Exit fullscreen mode

Conclusion

The official guidance shows quickstarts of RHEL 7.3~ / Suse Linux / Ubuntu 16.04.
The tutorial of this post is a subspecies of Ubuntu's.
As I wrote in Introducion, Docker image is also available.

In my early days as an engineer, I didn't imagine SQL Server would become free to use on Linux even with some limitations...🙂

Thank you for your reading.
Happy computing.

Top comments (0)