当前位置:   article > 正文

CentOS 7 安装SQL Server 2017_centos7.9 安装 sql server 2017

centos7.9 安装 sql server 2017

CentOS 7 安装SQL Server 2017

使用数据库的小伙伴都知道,在本地Windows上安装SQL Server,是一件很繁琐的事情,你可能会遇到各种各样的错误,你需要排错才能安装,时间也较长;而且卸载也需要很长的时间。相对于Linux安装,只需内存分配大一点,配置好本地yum源,能连接上网络即可,安装速度快,10分钟即可,卸载也方便,没有垃圾残留。

一. 更换为国内源

步骤命令
备份mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载新的CentOS-Base.repo 到/etc/yum.repos.d/wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 或 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
生成缓存yum makecache

在这里插入图片描述

二. 安装SQL Server 2017并启动

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

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
三. 安装 SQL Server 命令行工具

  1. 下载 Microsoft Red Hat 存储库配置文件
curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
  • 1

在这里插入图片描述
2. 运行以下命令以安装mssql 工具与 unixODBC 开发人员包

yum install -y mssql-tools unixODBC-devel
  • 1

在这里插入图片描述
4. 添加/opt/mssql-tools/bin/路径到环境变量

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
  • 1
  • 2
  • 3

在这里插入图片描述

安装完毕
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/827627
推荐阅读
相关标签
  

闽ICP备14008679号