1. Home
  2. Hosting & Servers
  3. Windows Hosting
  4. How to Install and Use MS SQL Server On CentOS
  1. Home
  2. Hosting & Servers
  3. Web Hosting
  4. How to Install and Use MS SQL Server On CentOS
  1. Home
  2. Hosting & Servers
  3. Windows Hosting
  4. How to Install and Use MS SQL Server On CentOS
  1. Home
  2. Hosting & Servers
  3. Web Hosting
  4. How to Install and Use MS SQL Server On CentOS

How to Install and Use MS SQL Server On CentOS

1. Insert the following lines into – /etc/yum.repos.d/sql-server.repo:

[packages-microsoft-com-mssql-server]
name=packages-microsoft-com-mssql-server
baseurl=https://packages.microsoft.com/rhel/7/mssql-server/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

Install the MS SQL Server, Create /etc/yum.repos.d/msprod.repo with these contents:

[packages-microsoft-com-prod]
name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/rhel/7/prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

2. Then install the packages using the Yum package manager, as usual:

# yum install -y mssql-server mssql-tools

3. Open port 1433/tcp on your firewall in order to allow external clients to communicate with the database server:

If you’re using a firewall:

# firewall-cmd --add-port=1433/tcp --permanent
# firewall-cmd --reload

Otherwise (using IP Tables):

# iptables -A INPUT -p tcp --dport 1433 -j ACCEPT
# iptables-save > /etc/sysconfig/iptables

 

 

Updated on April 21, 2020

Was this article helpful?