在Linux 7上如何通过官方Repo在线安装SQL Server 2017

2023-05-21,

这篇文章主要介绍在Linux 7上如何通过官方Repo在线安装SQL Server 2017,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

挂载数据盘

#vgdispaly的Total PE

安装SQL Server服务端

1.下载SQL Server Red Hat Repository配置文件:

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

2.安装SQL Server实例

yum install -y mssql-server

3.运行mssql-conf setup按照提示配置,选择版本、设置SA密码。

/opt/mssql/bin/mssql-conf setup

4.验证服务是否正常运行:

systemctl status mssql-server

5.禁用firewalld

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

6.禁用selinux

getenforce
setenforce 0
vi /etc/sysconfig/selinux

修改SELINUX值为disabled

安装SQL Server命令行工具

若要创建数据库时,需要使用一种工具,可以在 SQL Server 上运行的 Transact SQL 语句进行连接。 以下是 SQL Server 命令行工具: sqlcmd和bcp。

1.下载Red Hat Repo配置文件。

curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo

2.卸载旧版的unixODBC包。

yum remove unixODBC-utf16 unixODBC-utf16-devel

3.安装命令行工具

yum install -y mssql-tools unixODBC-devel

4.将/opt/mssql-tools/bin/添加到PATH环境变量。

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
本地连接

以上是“在Linux 7上如何通过官方Repo在线安装SQL Server 2017”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注本站行业资讯频道!

《在Linux 7上如何通过官方Repo在线安装SQL Server 2017.doc》

下载本文的Word格式文档,以方便收藏与打印。