SQL Server – Installation on Linux/CentOS

Background

Let us install SQL Server v2017 on our CentOS System.

Installation

Outline

  1. Repositories
    • Review registered Repositories
    • Add missing Repositories
  2. MS SQL Server Engine
    • Install
    • Configure
  3. Services
    • Service Review
  4. Adjust Network Firewall Rules
  5. Validate

Repositories

Review Registered Repositories

yum repolist

Syntax

yum repolist

Output

yum.repolist.20181126.0831PM.PNG

Explanation

We do not see the repositories that we need :-

  1. Repositories
    • packages-microsoft-com-mssql-server-2017

 

yum repository – add

Sample
Sample – Add SQL Server RTM

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017-gdr.repo

 

Sample – Add Cumulative Patch

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

 

Review Registered Repositories

yum repolist

Syntax

yum repolist

Output

yum.repolist.post.20181126.1034PM

Explanation
  1. Repositories
    • packages-microsoft-com-mssql-server-2017

 

Install

Install SQL Server Engine

Syntax

yum install -y mssql-server

Output

install.20181126.0859PM.PNG

 

Configuration

License

Syntax

sudo /opt/mssql/bin/mssql-conf setup
Output

sudo-ms-config-20181126-0914PM.PNG

 

Explanation
  1. Licensing
    • Developer
  2. sa password
    • Enter and Confirm sa password

Services

Review Services :- mssql-server

Syntax

systemctl status [service]
Sample

systemctl status mssql-server

Output

systemctl.20181126.0917PM.PNG

Explanation
  1. Service is running

Firewall

iptables

Our Firewall Software is iptables.

Port TCP/1433 ( mssql-server )

/etc/sysconfig
Outline
  1. Using an editor load /etc/sysconfig/iptables
  2. Add Entry for TCP/port 1433
    • -A INPUT -p tcp -m state –state NEW -m tcp –dport 1433 -j ACCEPT
Image – Pre

firewall.etc.sysconfig.pre.20181126.0942PM.PNG

Image – Post

firewall.etc.sysconfig.post.20181126.1052PM

Reload
Syntax

sudo systemctl reload iptables

Validation

SQL Query

@@version

Syntax

select @@version

Output

@@version.20181126.1110PM

 

References

  1. CentOS.Org
  2.  DigitalOcean
    • Mitchell Anicas
      • How To List and Delete Iptables Firewall Rules
        Link
  3. Sharad Chhetri
    • How to start / stop / restart / reload iptables on CentOS 7 / RHEL 7
      Link

 

 

One thought on “SQL Server – Installation on Linux/CentOS

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s