SQL Server on Linux

After the Microsoft Connect(); 2016 Microsoft announced a public available preview of SQL Server for Linux. Since I’m a fan of Microsofts “Microsoft <3 Linux” thinking, after hearing that a preview of SQL Server on Linux is available, I had to test it out.

If you also want to try out how to test SQL Server on Linux, I have written down a small introduction:

First of all, make sure your Linux server has enough memory. To install SQL Server on Linux the system needs a minimum of 3.25GB of RAM. If you don’t have enough this error will appear:

For testing I would recommend a VM running Ubuntu 16.04 on Hyper-V. My VM has a static amount of 4GB RAM configured which runs perfect for my small installation and connecting tests.

Next part is to have an account which I will use. In my case I simply created an account named “sql” while installing the Ubuntu OS. This user has root rights, so please do not use this scenario in production.

The installation of SQL Server is really easy, first it is necessary to add the Microsoft apt repo for SQL Server:

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

curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list

These two commands first add the gpg keys of the repos and then adds the repos

Now the package list has to be refreshed:

sudo apt-get update

After the lists are updated, the SQL Server can be downloaded and installed with the following command:

sudo apt-get install -y mssql-server

After the command finished successfully, you can see this:

And with the start of the sqlservr-setup script an initial configuration will be started:

sudo /opt/mssql/bin/sqlservr-setup

After you can read “Setup completed successfully” you’re done. The installation is complete.

To check if everything works, I started a SQL Server Management Studio on a different system:

And, it works:

So, as you can see SQL Server on Linux works and it basically really simple.

In the next days I want to try more with this. So far, have fun with SQL Server on Linux 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.