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

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