1. installation
wget https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo -P /etc/yum.repos.d/
wget https://packages.microsoft.com/config/rhel/7/prod.repo -P /etc/yum.repos.d/
yum install -y mssql-server mssql-tools unixODBC-devel
2. configuration
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' > /etc/profile.d/mssql.sh
source /etc/profile.d/mssql.sh
/opt/mssql/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
Do you accept the license terms? [Yes/No]:yes
Enter the SQL Server system administrator password: <<<<<<<<<<<<<<<<< Passw0rd
Confirm the SQL Server system administrator password: <<<<<<<<<<<<<<<<< Passw0rd
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.
systemctl status mssql-server.service
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-04-24 18:09:02 CEST; 1min 12s ago
Docs: https://docs.microsoft.com/en-us/sql/linux
Main PID: 1183 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─1183 /opt/mssql/bin/sqlservr
└─1199 /opt/mssql/bin/sqlservr
Apr 24 18:09:08 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:08.43 spid18s Server is listening on [ 'any' <ipv4> 1433].
Apr 24 18:09:08 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:08.44 spid18s Dedicated administrator connection support was not started because it is disabled on this e...
Apr 24 18:09:08 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:08.46 spid9s Polybase feature disabled.
Apr 24 18:09:08 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:08.47 spid9s Clearing tempdb database.
Apr 24 18:09:08 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:08.50 spid18s SQL Server is now ready for client connections. This is an informational message;... required.
Apr 24 18:09:09 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:09.28 spid9s Starting up database 'tempdb'.
Apr 24 18:09:09 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:09.73 spid21s The Service Broker endpoint is in disabled or stopped state.
Apr 24 18:09:09 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:09.73 spid21s The Database Mirroring endpoint is in disabled or stopped state.
Apr 24 18:09:09 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:09.80 spid7s Recovery is complete. This is an informational message only. No user action is required.
Apr 24 18:09:09 srv121.d01.net sqlservr[1183]: 2018-04-24 18:09:09.81 spid21s Service Broker manager has started.
Hint: Some lines were ellipsized, use -l to show in full.
3. services
systemctl enable mssql-server.service
systemctl start mssql-server.service
4. usage
sqlcmd -S localhost -U SA -P Passw0rd -Q "select Name from sys.Databases"
sqlcmd -S localhost -U SA -P Passw0rd -Q "create database cid"