Centos7.7安装SQL Server具体方法

SQL Serve是微软发布的新一代数据平台产品。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 && setenforce 0

添加软件源并安装依赖包

[root@localhost ~]# curl https://packages.microsoft.com/config/rhel/7/prod.repo -o /etc/yum.repos.d/msprod.repo
[root@localhost ~]# yum -y install mssql-tools unixODBC-devel bzip2 gdb libsss_nss_idmap cyrus-sasl cyrus-sasl-gssapi

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

安装SQL Server2019

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

[root@localhost ~]# rpm -ivh mssql-server-15.0.4003.23-3.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
  1:mssql-server-15.0.4003.23-3      ################################# [100%]

+--------------------------------------------------------------+
Please run 'sudo /opt/mssql/bin/mssql-conf setup'
to complete the setup of Microsoft SQL Server
+--------------------------------------------------------------+

运行初始化配制

[root@localhost ~]# /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): 3   #这里选择了Express版本
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 #输入Yes接受许可条目

Enter the SQL Server system administrator password:   #设置SA管理员密码
Confirm the SQL Server system administrator password:
Configuring SQL Server...

The licensing PID was successfully processed. The new edition is [Express Edition].
ForceFlush is enabled for this instance.
ForceFlush feature is enabled for log durability.
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.

添加环境变量

[root@localhost ~]# echo 'export PATH=$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=mssql
success
[root@localhost ~]# firewall-cmd --reload
success

命令行工具连接测试

[root@localhost ~]# sqlcmd -S localhost -U sa
Password:
# 显示系统数据库
1> select name,database_id from sys.databases;
# 执行
2> go
name                                                                                                                             database_id
-------------------------------------------------------------------------------------------------------------------------------- -----------
master                                                                                                                                     1
tempdb                                                                                                                                     2
model                                                                                                                                      3
msdb                                                                                                                                       4

(4 rows affected)
# 查看软件版本
1> SELECT @@VERSION
2> go
                                                                                                                                                                                                                                                                                                           
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2019 (RTM-CU1) (KB4527376) - 15.0.4003.23 (X64)
Dec  6 2019 14:53:33
Copyright (C) 2019 Microsoft Corporation
Express Edition (64-bit) on Linux (CentOS Linux 7 (Core))                                                                                                      

(1 rows affected)
1>

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

在客户端连接数据库

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

总结

内存设置为2G的时候,安装SQL Server2019会出现安装失败,提示内存最少为2000M,所以设置不要低于2G内存,安装还是很简单的。

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/10618.html

(0)
晴川运维晴川运维
上一篇 3小时前
下一篇 3小时前

相关推荐

  • CentOS 6.8编译安装LNMP

    搭建环境:centos 6.8,nginx 1.9.14,MySQL 5.6.23,php 5.6.17 二、LNMP安装环境准备:关闭防火墙及selinuxservice ipt…

    CentOS 2025年6月8日
  • Centos7.7 配置FreeIPA 具体步骤

    FreeIPA是一款集成的安全信息管理解决方案。FreeIPA包含Linux (Fedora),389 Directory Server MIT Kerberos, NTP, DN…

    CentOS 2025年6月8日
  • shell脚本切割Tomcat的日志文件

    鉴于在调试logback和log4j的文件切割一直无法成功,随性用shell写个脚本用来切割tomcat下的日志文件(大家如果有在logback或log4j使用文件切割成功的话,可…

    CentOS 2025年6月8日
  • CentOS7 Minimal 最小化安装后再安装GNOME图形界面

    centos7 Minimal下安装图形化界面的方法,有些时候纯命令界面确实比较累,个人学习可以使用图像界面,服务器强烈不建议用图形界面。 登录系统,使用yum 安装 yum -y…

    CentOS 2025年6月8日
  • CentOS6.5下Python版本的ProtoBuf编译及安装

    因为要学习faster r-cnn,在搭建环境的时,发现原本通过yum安装的protobuf没有安装python版本以及其他一系列版本版本兼容性问题,导致我必须用编译方式重新安装p…

    CentOS 2025年6月16日
  • CentOS 7 中创建RAID 10磁盘阵列

    RAID10也被称为镜象阵列条带。象RAID0一样,数据跨磁盘抽取;象RAID1一样,每个磁盘都有一个镜象磁盘, 所以RAID 10的另一种会说法是 RAID 0+1。RAID10…

    CentOS 6天前
  • Visual Studio Code 配置C/C++环境

    0. 前言 VS Code 是微软发布一款跨平台的源代码编辑器,其拥有强大的功能和丰富的扩展,使之能适合编写许多语言。 本文面向初学者(但不是纯小白),分享一点我配置C/C++的经…

    CentOS 2025年6月10日
  • CentOS下快速修改时区

    linux在安装的时候如果时区选择错误,可以在系统安装完成之后修改。系统时间运行着也会有偏差,需要对时间进行实时同步,本篇文章为大家讲解一下快速修改时区具体方法。 方法1: tim…

    CentOS 2025年6月9日
  • 虚拟机下CentOS 6.5配置IP地址的三种方法

    实验软件环境:虚拟机VMware Workstation10.0 、centos 6.5 32位 1、自动获取IP地址虚拟机使用桥接模式,相当于连接到物理机的网络里,物理机网络有D…

    CentOS 2025年6月8日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注