Personal documentation during development phase and still learning new technology
Installing SQL Server on Ubuntu
Installing SQL Server on Ubuntu

Installing SQL Server on Ubuntu

Microsoft just launched SQL Server vNEXT CTP1 for Linux, below is tutorial for installing SQL Server on Ubuntu

Prerequisites:

  1. Internet connection
  2. At least Ubuntu 16.04 64bit

Here’s the steps to install SQL Server on Ubuntu

  1. Import the public repository GPG keys

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

  2. Add Microsoft SQL Server Ubuntu repository

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

  3. Run commands below

    sudo apt-get update

    sudo apt-get install -y mssql-server

  4. Once the installation finish, run the script to install

    sudo /opt/mssql/bin/sqlservr-setup

  5. Once it’s done, register SQL Server services to the system

    systemctl status mssql-server

Install SQL Server Tools

The following steps install the command-line tools, Microsoft ODBC drivers, and their dependencies. The mssql-tools package contains:

  • sqlcmd: Command-line query utility.
  • bcp: Bulk import-export utility.

Install tools on Linux

  1. RHEL

    sudo su

    curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo

    exit

    sudo yum install mssql-tools

  2. Ubuntu

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

    curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

    sudo apt-get update

    sudo apt-get install mssql-tools

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.