SQL Server 2019 for Linux – 安装SQL2019 on Linux



# 检查防火墙状态
systemctl status firewalld
# 停止防火墙服务
systemctl stop firewalld
systemctl disable firewalld


firewall-cmd --zone=public --add-port=1433/tcp --permanent
firewall-cmd --reload


# vim /etc/selinux/config
将SELINUX=enforcing 变更为 SELINUX=disabled

下载 Microsoft SQL Server 2019 Red Hat 存储库配置文件

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

运行命令安装SQL Server 2019

yum install -y mssql-server

运行 mssql-conf setup,按照提示设置 SA 密码并选择版本。

/opt/mssql/bin/mssql-conf setup
usermod: no changes
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) - CPU Core utilization restricted to 20 physical/40 hyperthreaded
7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum
8) I bought a license through a retail sales channel and have a product key to enter.

Details about editions can be found at

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): 6
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:

The privacy statement can be viewed at:

Do you accept the license terms? [Yes/No]:yes
Enter the SQL Server system administrator password:Pass@123

Confirm the SQL Server system administrator password:Pass@123


systemctl status mssql-server

现在我们就已经安装完成,可以在Linux上使用SQL Server 2019啦。



电子邮件地址不会被公开。 必填项已用*标注