在CentOS 8上安装Microsoft SQL Server
步骤1.首先,让我们首先确保您的系统是最新的。
sudo dnf clean all
sudo dnf update
步骤2.在CentOS 8上安装Microsoft SQL Server。
我们需要添加SQL Server 2019存储库:
sudo curl https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo -o /etc/yum.repos.d/mssql-server-2019.repo sudo curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/msprod.repo
接下来,运行以下命令来安装SQL Server:
sudo dnf install mssql-server
软件包安装完成后,运行安装程序并按照提示设置SA密码并选择您的版本:mssql-conf
$ /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. # select an edition you'd like to use 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
配置完成后,请验证该服务正在运行,并且应该启动该服务并将其设置为在启动时启动:
sudo systemctl status mssql-server.service sudo systemctl is-enabled mssql-server.service
步骤3.为MS SQL配置防火墙。
默认的SQL Server端口是TCP1433。如果您使用FirewallD作为防火墙,则可以使用以下命令:
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent sudo firewall-cmd --reload
步骤4.连接到MS SQL Server。
安装完成后,使用以下命令连接到MS SQL服务器:
sqlcmd -H 127.0.0.1 -U sa Password: 1>
sqlcmd
带有用于SQL Server名称(-S),用户名(-U)和密码(-P)的参数。
有关其他帮助或有用信息,我们建议您检查Microsoft SQL Server官方网站。
原创文章,作者:校长,如若转载,请注明出处:https://www.yundongfang.com/Yun40997.html