Microsoft SQL Server on Linux – installation (Ubuntu)
With the release of Microsoft SQL Server 2017 (SQL Server 2017) comes the ability to run SQL Server on the Linux Operating Systems. With Linux being the platform of choice for millions of application developers this is a smart move by Microsoft as they have publicly committed to making SQL Server on Linux as good as the windows offering with many of the same features delivered in a familiar format enabling application developers the choice of using this established RDBMS. This article will give detailed instruction on how to install SQL on Linux for the most popular distribution, Ubuntu
Ubuntu Installation
Prerequisites
Ubuntu 16.04 or later with 2GB RAM is required to run SQL Server on UbuntuSQL Server Installation Steps
- The first step is to import the public repository keys.
- Now we need to register the Microsoft SQL Server Repository
- Update Local Repository information
- Next, the below command will install SQL Server
- We now need to complete the install with some basic configuration. In order to do that run the below command and follow the prompts
- Select the edition of SQL Server you would like to install and agree to terms
- Select Language
- Enter a Secure SA Password
- Installation is complete
- Just to confirm we can check to make sure the SQL Server service is running
Command Line Tools Installation
Now that we have a successful installation of SQL server we need to install tools to enable us to connect to the instance. The following steps will install command line tools and show you how to create a test database.- First, we need to register another repository to be able to access the installation files
- As we have added a new Repository we now need to update our local repository information
- Now we can install the command line tools with the below command. You will need to agree to the terms for the 2 packages.
- That completes the installation of the Command Line Tools. For Convenience i like to complete one more step to add /opt/mssql-tools/bin/ to my $PATH Variable. This allows me to call the command line tools without specifying the full path
Connecting to SQL Server and Creating a Database
- Run the below command to connect to SQL Server. you will be prompted to enter your password
- If you are connecting remotely you can pass the server name or IP address to the -S parameter. (You will also need to ensure that port 1433 is open in the firewall)
- Now that we have a connection to SQL Server we can run regular TSQL Commands. Below are a few for you to try out
Summary
I hope this helps you all get started with SQL Server On Linux. Please feel free to leave comments or questions below. My next post will go in to more detail regarding the configuration options in Linux. Stay Tuned.Learn more about Pythian Services for Microsoft SQL Server including professional consulting, implementation and ongoing support.
Share this
You May Also Like
These Related Stories
Windows containers: installing SQL server
Windows containers: installing SQL server
Sep 21, 2015
8
min read
A simple command that saved me
A simple command that saved me
May 1, 2019
1
min read
Centralized authentication with Red Hat directory server for Linux systems
Centralized authentication with Red Hat directory server for Linux systems
Mar 10, 2016
12
min read
No Comments Yet
Let us know what you think