How to Install Microsoft SQL on Linux


In this video, we demonstrate how to do install Microsoft SQL on Linux, specifically versions of CentOS 7 and Ubuntu 18.04.

Commands used:

CentOS 7
[[email protected] ~]# yum update -y
[[email protected] ~]# curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-preview.repo
[[email protected] ~]# yum install -y mssql-server
[[email protected] ~]# /opt/mssql/bin/mssql-conf setup
2) Developer (free, no production use rights)
[[email protected] ~]# systemctl status mssql-server
[[email protected] ~]# curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
[[email protected] ~]# yum install -y mssql-tools unixODBC-devel
[[email protected] ~]# echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> 
~/.bash_profile
[[email protected] ~]# echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bashrc
[[email protected] ~]# source ~/.bashrc
[[email protected] ~]# sqlcmd -S localhost -U SA

Ubuntu 18.04 LTS
[email protected]:~# apt-get update -y
[email protected]:~# wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add –
[email protected]:~# add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-preview.list)”
[email protected]:~# apt-get install -y apt-transport-https
[email protected]:~# apt-get update -y
[email protected]:~# apt-get install -y mssql-server
[email protected]:~# /opt/mssql/bin/mssql-conf setup
2) Developer (free, no production use rights)
[email protected]:~# systemctl status mssql-server –no-pager
[email protected]:~# apt-get install -y ufw
[email protected]:~# ufw enable
[email protected]:~# ufw allow 1433
[email protected]:~# curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add –
[email protected]:~# curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/msprod.list
[email protected]:~# apt-get update -y
[email protected]:~# apt-get install -y mssql-tools unixodbc-dev
[email protected]:~# echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bash_profile
[email protected]:~# echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bashrc
[email protected]:~# source ~/.bashrc
[email protected]:~# sqlcmd -S localhost -U SA

The related article for this article can be found here: https://www.liquidweb.com/kb/how-to-install-microsoft-sql-on-linux/

For more information about this and other topics, visit us at https://www.liquidweb.com/kb/ or for more information about our products, visit: https://www.liquidweb.com/products/ to learn more about our current specials!

Video by: Justin Palmer


Duration: 6:24
Publisher: Liquid Web
You can watch this video also at the source.