这篇文章主要介绍在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.repohttps://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

2.安装SQL Server实例

yuminstall-ymssql-server

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

/opt/mssql/bin/mssql-confsetup

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

systemctlstatusmssql-server

5.禁用firewalld

systemctlstatusfirewalldsystemctlstopfirewalldsystemctldisablefirewalld

6.禁用selinux

getenforcesetenforce0vi/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.repohttps://packages.microsoft.com/config/rhel/7/prod.repo

2.卸载旧版的unixODBC包。

yumremoveunixODBC-utf16unixODBC-utf16-devel

3.安装命令行工具

yuminstall-ymssql-toolsunixODBC-devel

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

echo'exportPATH="$PATH:/opt/mssql-tools/bin"'>>~/.bash_profileecho'exportPATH="$PATH:/opt/mssql-tools/bin"'>>~/.bashrcsource~/.bashrc本地连接

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