Installing MS-SQL on CentOS 7

This setup is using an instance within Google Cloud Platform's Compute Engine, but it should work about anywhere running CentOS 7+. I added this here because I needed to try mssql on Centos, an unsupported distro. Other howto's online I found did not work, or did not completely set it up in a usable form. This worked great for me. Let me know if you have issues.

Installing mssql server in linux

gcloud compute ssh instancename

obtain root

sudo su -
cd /etc/yum.repos.d/

grab the repo file(s) with wget, and store it/them in /etc/yum.repos.d/

wget https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo 

you might want to grab the cli client for linux as well. You can grab the repo here:

wget https://packages.microsoft.com/config/centos/7/prod.repo

now we'll install mssql-server-2017 and the cli-client

sudo yum install mssql-server-agent mssql-server

and install the command line client:

sudo yum install mssql-cli

At this point, ms-sql is installed. We need to set up the new server.

cd /opt/mssql/bin/
./mssql-conf setup

you should be greeting with the following screen to pick your license.

[root@ms-sql bin]# ./mssql-conf setup
Choose an edition of SQL Server:  
  1) Evaluation (free, no production use rights, 180-day limit)
  2) Developer (free, no production use rights)
  3) Express (free)
  4) Web (PAID)
  5) Standard (PAID)
  6) Enterprise (PAID)
  7) Enterprise Core (PAID)
  8) I bought a license through a retail sales channel and have a product key to enter.

Details about editions can be found at  
https://go.microsoft.com/fwlink/?LinkId=852748&clcid=0x409

Use of PAID editions of this software requires separate licensing through a  
Microsoft Volume Licensing program.  
By choosing a PAID edition, you are verifying that you have the appropriate  
number of licenses in place to install and run this software.

Enter your edition(1-8): 3  
The license terms for this product can be found in  
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=855862&clcid=0x409

The privacy statement can be viewed at:  
https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409

Enter the SQL Server system administrator password:  
Confirm the SQL Server system administrator password:  
Configuring SQL Server...

The licensing PID was successfully processed. The new edition is [Express Edition].  
ForceFlush is enabled for this instance.  
ForceFlush feature is enabled for log durability.  
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.  
Setup has completed successfully. SQL Server is now starting.  

The wizard will walk you though picking your licenses, and sa password. Once the password is set, SQL server will start, licensed

[root@ms-sql bin]# mssql-cli 
Username (press enter for sa):
Password: 
Version: 0.13.0
Mail: sqlcli@microsoft.com
Home: http://github.com/dbcli/mssql-cli
master>