这篇文章主要介绍“Centos7.7中怎么安装SQL Server”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Centos7.7中怎么安装SQL Server”文章能帮助大家解决问题。

准备工作

系统版本:Centos7.7 ,内存4G(SQL Server内存要求至少2G),硬盘40G,1核CPU

SQL Server版本:SQL Server 2019,下载地址

SQL Server Management Studio 版本:V18.4,安装在windows客户端下载地址,Windows 2008R2(64位)或Windows8.1(64位)以上

关闭SELINUX

[root@localhost~]#sed-i'/^SELINUX/s/enforcing/disabled/g'/etc/selinux/config&&setenforce0添加软件源并安装依赖包

[root@localhost~]#curlhttps://packages.microsoft.com/config/rhel/7/prod.repo-o/etc/yum.repos.d/msprod.repo[root@localhost~]#yum-yinstallmssql-toolsunixODBC-develbzip2gdblibsss_nss_idmapcyrus-saslcyrus-sasl-gssapi

Centos7.7安装SQL Server 2019Centos7.7安装SQL Server 2019
安装SQL Server2019

下载文章上面提供的SQL Server2019,上传到服务器并安装

[root@localhost~]#rpm-ivhmssql-server-15.0.4003.23-3.x86_64.rpmPreparing...#################################[100%]Updating/installing...1:mssql-server-15.0.4003.23-3#################################[100%]+--------------------------------------------------------------+Pleaserun'sudo/opt/mssql/bin/mssql-confsetup'tocompletethesetupofMicrosoftSQLServer+--------------------------------------------------------------+运行初始化配制

[root@localhost~]#/opt/mssql/bin/mssql-confsetupusermod:nochangesChooseaneditionofSQLServer:1)Evaluation(free,noproductionuserights,180-daylimit)2)Developer(free,noproductionuserights)3)Express(free)4)Web(PAID)5)Standard(PAID)6)Enterprise(PAID)-CPUCoreutilizationrestrictedto20physical/40hyperthreaded7)EnterpriseCore(PAID)-CPUCoreutilizationuptoOperatingSystemMaximum8)Iboughtalicensethrougharetailsaleschannelandhaveaproductkeytoenter.Detailsabouteditionscanbefoundathttps://go.microsoft.com/fwlink/?LinkId=2109348&clcid=0x409UseofPAIDeditionsofthissoftwarerequiresseparatelicensingthroughaMicrosoftVolumeLicensingprogram.BychoosingaPAIDedition,youareverifyingthatyouhavetheappropriatenumberoflicensesinplacetoinstallandrunthissoftware.Enteryouredition(1-8):3#这里选择了Express版本Thelicensetermsforthisproductcanbefoundin/usr/share/doc/mssql-serverordownloadedfrom:https://go.microsoft.com/fwlink/?LinkId=2104294&clcid=0x409Theprivacystatementcanbeviewedat:https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409Doyouacceptthelicenseterms?[Yes/No]:Yes#输入Yes接受许可条目EntertheSQLServersystemadministratorpassword:#设置SA管理员密码ConfirmtheSQLServersystemadministratorpassword:ConfiguringSQLServer...ThelicensingPIDwassuccessfullyprocessed.Theneweditionis[ExpressEdition].ForceFlushisenabledforthisinstance.ForceFlushfeatureisenabledforlogdurability.Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/mssql-server.serviceto/usr/lib/systemd/system/mssql-server.service.Setuphascompletedsuccessfully.SQLServerisnowstarting.添加环境变量

[root@localhost~]#echo'exportPATH=$PATH:/opt/mssql-tools/bin'>/etc/profile.d/mssql.sh[root@localhost~]#source!$source/etc/profile.d/mssql.sh防火墙添加服务

[root@localhost~]#firewall-cmd--permanent--add-service=mssqlsuccess[root@localhost~]#firewall-cmd--reloadsuccess命令行工具连接测试

[root@localhost~]#sqlcmd-Slocalhost-UsaPassword:#显示系统数据库1>selectname,database_idfromsys.databases;#执行2>gonamedatabase_id-------------------------------------------------------------------------------------------------------------------------------------------master1tempdb2model3msdb4(4rowsaffected)#查看软件版本1>SELECT@@VERSION2>go------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------MicrosoftSQLServer2019(RTM-CU1)(KB4527376)-15.0.4003.23(X64)Dec6201914:53:33Copyright(C)2019MicrosoftCorporationExpressEdition(64-bit)onLinux(CentOSLinux7(Core))(1rowsaffected)1>

Centos7.7安装SQL Server 2019Centos7.7安装SQL Server 2019
在客户端连接数据库

安装上面提供的SSMS管理软件,安装完成之后搜索”ssms”,打开该管理软件 输入服务器地址,身份验证选择“SQL Server身份验证”,输入用户名密码,然后连接。 查看一下SQL Server版本

关于“Centos7.7中怎么安装SQL Server”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。