SQL Server on Linux

A simple $ docker ps shows the container is up and running:


CONTAINER ID     IMAGE                                     
EDD1E0EBEA6E   microsoft/mssql-server-linux  
      ↪STATUS                        PORTS
      ↪Up About an hour        0.0.0.0:1433->1433/tcp

Accessing the database server is equally straightforward:


$ sqlcmd -S 192.168.1.15 -U SA -P '(!)Superpassword'

There are some handy tools you can use on Linux, Mac or Windows to connect to the SQL server instance. I used Microsoft's sqlcmd tool on Mac and Linux boxes to connect to the running database instance.

Once connected with sqlcmd, you can start running all your familiar SQL commands. I created a database called "testdb", created a table called "inventory" and added three rows of data. Logging in, I was able to connect and query the results quickly:

The containerized SQL Server can be managed through a number of other tools, including Visual Studio Code and SQL Server Management Studios for Windows. Red Hat and SUSE already have built-in management tools available in their enterprise server editions.

No matter how you choose to deploy SQL Server on Linux, you'll find it easy to start testing it and getting a feel for how it might play in different database scenarios you have in mind. You also might find that having a Microsoft tool running happily on Linux isn't as far-fetched as it might've seemed even just a year ago.

Resources

SQL Server on Linux: https://www.microsoft.com/en-US/sql-server/sql-server-2017

Install SQL Server in a Docker Container: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-docker

Install SQL Server on Ubuntu: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ubuntu

Install SQL Command-Line Tools for Linux: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ubuntu

Microsoft SQL Server Pricing: https://www.microsoft.com/en-us/sql-server/sql-server-2016-pricing

______________________

John S. Tonello is Director of IT for NYSERNet, Inc., in Syracuse, New York. He's been a Linux user and enthusiast since he installed his first Slackware system from diskette 20 years ago. You can follow him @johntonello.