I have written before that the article on installing SQL Server 2016 under Linux is as follows:
Preparation:Install SQL Server 2016 under Linux (Preparation)
Installation:Install SQL Server 2016 under Linux (Installation)
Connection:Install SQL Server 2016 under Linux (Connection)
In October 2017, SQL Server 2017 was released. The following will write about how to install SQL Server 2017 under Linux. The overall process is similar, but some places are different.
SQL SERVER 2017 can be installed on a variety of Linux. Here we mainly talk about the installation on CentOS. The supported version is Red Hat Enterprise Linux 7.3 or 7.4. I use CentOS 7.4.If you install it on a lower version, such as CentOS 7.2, various problems may occur.
The steps to install CentOS 7.4 can be found inInstall SQL Server 2016 under Linux (Preparation), similar to installing CentOS 7.2.
By the way, CentOS is doing better and better, I must give you a thumbs up.
Installation:Install SQL Server 2017 under Linux (Installation)
Connection:Install SQL Server 2017 under Linux (Connection)
Installation process
The entire installation process is very simple.
You can refer to Microsoft's detailed documentation:SQL Server Installation Guide on Linux, contains methods to install on multiple Linux branches.
This article is executed using root identity. If it is not a root account,You need to prefix the following commands, add sudo, use a simulated root account to run various commands.
(1)Download the Microsoft SQL Server Red Hat repository configuration file
curl -o /etc// /config/rhel/7/
(2)Install SQL Server
yum install -y mssql-server
(3) After the software package is installed, runmssql conf installationThe command (there is a difference from the 2016 installation command), configure it.
/opt/mssql/bin/mssql-conf setup
According to the prompts:
First, select the version, and select Enter 1 here to be the evaluation version.
Chapter 2, Acceptance.
Third, choose language, the 10 selected here is Simplified Chinese.
4. Enter the password of SA. The password is required to be at least 8 digits, including numbers, upper and lower case letters, and symbols, which are highly secure.
In step 5, the configuration program will create the mssql-server service and set the startup self-start.
[root@localhost ~]# /opt/mssql/bin/mssql-conf setup
Select a version of SQL Server:
1) Evaluation (free, no production license, 180-day limit)
2) Developer (free, no production license)
3) Express (Free)
4) Web (paid version)
5) Standard (paid version)
6) Enterprise (paid version)
7) Enterprise Core (paid version)
8) I purchased the license through the retail channel and had the product key to enter.
Detailed information about the version can be found at:
/fwlink/?LinkId=852748&clcid=0x804
Use paid versions of this software require separate authorization through the following channels
Microsoft Volume License Plan.
Selecting a paid version means you have the applicable one
Number of in-place licenses to install and run this software.
Input version (1-8): 1
The license terms for this product can be found at:
/usr/share/doc/mssql-server or download from:
/fwlink/?LinkId=855864&clcid=0x804
The privacy statement can be viewed from:
/fwlink/?LinkId=853010&clcid=0x804
Do you accept this license terms? [Yes/No]:Yes
Select the language for SQL Server:
(1) English
(2) Deutsch
(3) Español
(4) Français
(5) Italiano
(6) Japanese
(7) 한국어
(8) Português
(9) Русский
(10) Chinese – Simplified
(11) Chinese (Traditional)
Enter options 1-11:10
Enter the SQL Server system administrator password:
The specified password does not comply with the SQL Server password policy requirements because it is not complicated enough.
Passwords must contain at least 8 characters and contain any three of the following four character sets: uppercase letters, lowercase letters, numbers, and symbols.
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
Created symlink from /etc/systemd/system// to /usr/lib/systemd/system/.
The installer has been successfully completed. SQL Server is starting.
(4) After configuration, verify that the service is started
Judging from the output of the command, the sql-server service was successfully started, the main process sqlservr, process number 3601
[root@localhost ~]# systemctl status mssql-server
● - Microsoft SQL Server Database Engine
Loaded: loaded (/usr/lib/systemd/system/; enabled; vendor preset: disabled)
Active: active (running) since 1 2018-01-29 13:34:58 CST; 6min ago
Docs: /en-us/sql/linux
Main PID: 3601 (sqlservr)
CGroup: //
├─3601 /opt/mssql/bin/sqlservr
└─3631 /opt/mssql/bin/sqlservr
January 29 13:35:04 localhost sqlservr[3601]: 2018-01-29 13:35:04.94 spid11s ....
January 29 13:35:04 localhost sqlservr[3601]: 2018-01-29 13:35:04.94 spid11s ....
January 29 13:35:05 localhost sqlservr[3601]: 2018-01-29 13:35:05.75 spid11s ....
January 29 13:35:06 localhost sqlservr[3601]: 2018-01-29 13:35:06.08 spid11s ....
January 29 13:35:06 localhost sqlservr[3601]: 2018-01-29 13:35:06.10 spid22s ....
January 29 13:35:06 localhost sqlservr[3601]: 2018-01-29 13:35:06.10 spid22s ....
January 29 13:35:06 localhost sqlservr[3601]: 2018-01-29 13:35:06.19 spid22s ....
January 29 13:35:06 localhost sqlservr[3601]: 2018-01-29 13:35:06.28 spid6s ....
January 29 13:40:09 localhost sqlservr[3601]: 2018-01-29 13:40:09.61 spid52 ....
January 29 13:40:09 localhost sqlservr[3601]: 2018-01-29 13:40:09.73 spid52 ....
Hint: Some lines were ellipsized, use -l to show in full.
Verify once with other commands and the startup is indeed successful:
[root@localhost ~]# ps -ef | grep mssql
mssql 3601 1 0 13:34 ? 00:00:00 /opt/mssql/bin/sqlservr
mssql 3631 3601 4 13:34 ? 00:00:23 /opt/mssql/bin/sqlservr
root 4113 3045 0 13:43 pts/0 00:00:00 grep --color=auto mssql
(5) If you want to connect to SQL Server from a remote location, then open the SQL Server port on the firewall, and the default port is 1433
[root@localhost ~]# firewall-cmd --zone=public --add-port=1433/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
After the above 5 steps, SQL Server 2017 was installed successfully.
The next article will talk about how to connect to the database.