Installing SQL Server on CentOS Linux

With Microsoft stating their commitment to SQL Server on Linux, system administrators will need to learn how to install, maintain, and use SQL Server. Preview version packages are already available for Red Hat Enterprise Linux 7, CentOS 7, and Ubuntu Server 16.04 64bit.

The only specific system requirement for the preview version is that you must have at least 3.25 GB of RAM.

Installation instructions for CentOS 7:

  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

To install the MS SQL Server command-line tools, 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 yum package manager, as usual:

# yum install -y mssql-server mssql-tools

When the installation is complete, you will be reminded to run the configuration script (/opt/mssql/bin/sqlservr-setup) to accept the license terms, set the password for the SA user, and start the service. Additionally, you can choose to enable it to start automatically on boot.

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

If you’re using firewalld:

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

Otherwise (using iptables):

# iptables -A INPUT -p tcp --dport 1433 -j ACCEPT
# iptables-save

You can then use your standard SQL Server Management Studio in Windows to connect to the instance.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s