How to Install Microsoft SQL on Linux

October 25, 2019 Liquid Web

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

About the Author

Liquid Web

Liquid Web powers online content, commerce, and potential for SMB entrepreneurs and the designers, developers and digital agencies who create for them. Sign up for our newsletter to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
Why InterWorx is a Great Control Panel for Resellers
Why InterWorx is a Great Control Panel for Resellers

Interested in learning more about InterWorx? Watch this On-Demand webinar and learn more about why InterWor...

Next Video
How To Install Software From Source on Ubuntu
How To Install Software From Source on Ubuntu

In this video we will cover the available options for installing software on Ubuntu using three different s...

Learn What Qualities to Look for in Your Next Host in Our New Guide!

Download Now