Windows way to Digital Learning……

Archive for March, 2017

How to Install Microsoft SQL Server on Linux

sql-on-linux

Now Microsoft SQL Server supports on Linux platforms.

I have tested on Redhat, CentOS and Oracle Linux.

Here we will see step by step guide to install SQL server on Linux.

Supported platforms

Platform

Supported version(s)

Get

Red Hat Enterprise Linux

7.3

Get RHEL 7.3

SUSE Linux Enterprise Server

v12 SP2

Get SLES v12 SP2

Ubuntu

16.04 and 16.10

Get Ubuntu 16.04

Docker Engine

1.8+

Get Docker

Prerequisites

  • You need at least 3.25 GB of memory to run SQL Server on Linux.

 

Install SQL Server

  • Login to root user using putty.

su - root

  • We will download and install SQL server repositories by using following commands.

# curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo
> /etc/yum.repos.d/mssql-server.repo

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

 

sql-on-linux_curl

  • Verify .repo files under /etc/yum.repos.d/ directory

sql-on-linux_repos

  • To install SQL Server and MSSQL Tools package, run the following commands
# yum install -y mssql-server mssql-tools

sql-on-linux_1

sql-on-linux_2

sql-on-linux_3

  • Run the configuration script to accept license terms and set SA password
# cd /opt/mssql/bin/
# sudo ./mssql-config setup

 

sql-on-linux_4

  • To verify the mssql-server service is running
# systemctl status mssql-server

sql-on-linux_5

  • To open tcp-1433 port on system firewall in order to allow external clients to communicate with the database server.
# firewall-cmd --add-port=1433/tcp --permanent
# firewall-cmd --reload

 

sql-on-linux_6

  • Testing SQL Server
# cd /opt/mssql-tool/bin/
# ./sqlcmd -S srv01 -U SA

 

 

Upgrade SQL Server

  • To upgrade the mssql-server package on Linux, execute the following command
# yum update mssql-server

Uninstall SQL Server

  • To uninstall or remove the mssql-server package on Linux, execute the following command

# yum remove mssql-server  
(Remove or delete mssql-server package)

# rm -rf /var/opt/mssql/
(Remove or delete database files)
Advertisements

Tag Cloud