从 SQL Server 2017 开始,SQL Server 开始可以在 Linux 上安装运行了。
主要支持的系统版本: Red Hat Enterprise Linux 7.3、7.4、7.5、7.6,8.0,8.1,8.2,8.3.8.4 SUSE Linux Enterprise Server v12 SP2 Ubuntu 16.04 Docker 引擎 1.8+
1.下载SQLSERVER2019 yum repo
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/c ... ql-server-2019.repo
2.配置好mssql-server的YUM源之后,使用yum命令安装。
# yum install mssql-server
用YUM安装完成后,还没有真正算安装成功,还需要设置一些东西,比如选择是启用开发版还是企业版,如果是启用企业版,是需要license才能激活的。 执行/opt/mssql/bin/mssql-conf setup命令,来做设置并激活SQL Server。
#/opt/mssql/bin/mssql-conf setup
[root@newdb yum.repos.d]# /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 https://go.microsoft.com/fwlink/?LinkId=2109348&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): 2 The license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?LinkId=2104294&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: Confirm the SQL Server system administrator password: Configuring SQL Server...
ForceFlush is enabled for this instance. ForceFlush feature is enabled for log durability.
会有8个版本选择,其中前3个是免费激活使用的。
个人使用的话,可以选择第2个“Developer"。
选择版本后,会让你设置SQL Server数据库管理员的账号密码。(密码需要有字母、数字、特殊符号,并且大于8位)
设置好密码后,SQL Server数据库的服务才会启动。
# systemctl status mssql-server
[root@newdb yum.repos.d]# 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 Mon 2021-07-05 18:24:43 CST; 36s ago Main PID: 3215 (sqlservr) Tasks: 145 Memory: 609.5M CGroup: /system.slice/mssql-server.service ├─3215 /opt/mssql/bin/sqlservr └─3241 /opt/mssql/bin/sqlservr
Jul 05 18:25:06 newdb sqlservr[3215]: [155B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [61B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [92B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [96B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [66B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [75B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [96B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [100B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [124B blob data] Jul 05 18:25:06 newdb sqlservr[3215]: [71B blob data]
|