在 Linux 上安装 SQL Server 2017
概述
通过将平台抽象层 (PAL) 引入 SQL Server,Linux 上的 SQL Server 成为可能。PAL 将所有操作系统特定代码集中在一处,并允许其余代码保持独立于操作系统。PAL 是 Microsoft 研究项目 Drawbridge 的成果。目前,Red Hat Enterprise Server、SUSE Linux Enterprise Server 和 Ubuntu 支持 SQL Server。它还支持在 Docker 容器中运行。
SQL Server for Linux版本,可以在某些Linux发行版上直接安装和运行。但是有一些具体系统要求,首先,确保你的Linux发行版满足SQL Server的要求。例如,SQL Server 2017要求操作系统为Red Hat Enterprise Linux(RHEL)7.3或Ubuntu 16.04 LTS,而SQL Server 2019要求操作系统为RHEL 8.0、SUSE Linux Enterprise Server(SLES)15或Ubuntu 18.04 LTS。
本文将阐述在 Linux 上安装 SQL Server 2017的具体过程。
为什么应该在 Linux 上运行 SQL Server?
企业需求:Linux 上的 SQL Server 为企业关键功能(例如使用针对 Linux 操作系统的开源集群机制的 AlwaysOn 可用性组的高可用性和灾难恢复)提供了一个可靠的平台。AlwaysOn 配置还可以将节点与 Linux 和 Windows 操作系统混合。AlwaysOn 可用性组可以帮助您的应用程序满足强大的业务连续性要求。
降低运营成本:组织在 Linux 上使用 SQL Server 时可以实现运营成本的降低。SQL Server 许可证允许它根据架构的需要在 Windows、Linux 或 Docker 上使用。跨平台的许可模型,允许在多操作系统环境中提供 SQL Server 功能。SQL Server 在 Windows 和 Linux 上的许可方式相同,例如,运行在windows上的现有许可证可以转移到 Linux,无需额外费用。
性能:与运行在 Windows 操作系统相比,Linux 上的 SQL Server 性能应该相当或更好。
简单性:Linux 上的 SQL Server 允许 SQL Server DBA 和开发人员使用现有工具和脚本执行日常任务,而无需关注其中的差异。在 Windows 上运行的所有核心数据库功能在 Linux 中也可用。但是,某些依赖于 Windows 功能的 SQL Server 功能将不可用。可以在此处找到不受支持的功能的列表。
安装和维护:在Linux上命令行安装SQL Server、补丁比Windows上相对要快。这使得企业能够节省代价高昂的停机时间。较旧版本的 SQL Server(例如 SQL Server 2008 或 2008 R2)可以轻松升级到 Linux 上较新版本的 SQL Server。
非生产环境一键完成:利用 docker 容器来配置非生产数据库环境,使开发人员和 DBA 能够立即执行测试。
安装过程
步骤 1:下载 Microsoft SQL Server Red Hat 存储库配置文件:
- 以 root 用户身份运行以下命令:
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo第 2 步:安装 SQL Server:
yum -y install mssql-server步骤 3:设置 SQL Server :
/opt/mssql/bin/mssql-conf setup- 安装程序将提示输入版本类型和 sa 密码,请在命令提示符上提供相关的信息。
The license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?LinkId=852741&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 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) 7) 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=852748&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-7): 2 Enter the SQL Server system administrator password: Confirm the SQL Server system administrator password: Configuring SQL Server... This is an evaluation version. There are [132] days left in the evaluation period. Setup has completed successfully. SQL Server is now starting.这样就完成了 Linux 上的 SQL Server 安装,您可以通过以下命令检查 SQL Server 服务和进程:
- 检查服务
systemctl status mssql-server输出:
● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2017-09-13 13:40:54 BST; 6min ago Docs: https://docs.microsoft.com/en-us/sql/linux Main PID: 6017 (sqlservr) CGroup: /system.slice/mssql-server.service ├─6017 /opt/mssql/bin/sqlservr └─6048 /opt/mssql/bin/sqlservr Sep 13 13:41:08 dbalab1 sqlservr[6017]: 2017-09-13 13:41:08.95 spid6s 8 transactions rolled forward in database 'msdb' (4:0). This is an informat... required. Sep 13 13:41:09 dbalab1 sqlservr[6017]: 2017-09-13 13:41:09.06 spid9s Polybase feature disabled. Sep 13 13:41:09 dbalab1 sqlservr[6017]: 2017-09-13 13:41:09.06 spid9s Clearing tempdb database. Sep 13 13:41:09 dbalab1 sqlservr[6017]: 2017-09-13 13:41:09.10 spid6s 0 transactions rolled back in database 'msdb' (4:0). This is an information... required. Sep 13 13:41:09 dbalab1 sqlservr[6017]: 2017-09-13 13:41:09.73 spid9s Starting up database 'tempdb'. Sep 13 13:41:10 dbalab1 sqlservr[6017]: 2017-09-13 13:41:10.19 spid9s The tempdb database has 1 data file(s). Sep 13 13:41:10 dbalab1 sqlservr[6017]: 2017-09-13 13:41:10.20 spid22s The Service Broker endpoint is in disabled or stopped state. Sep 13 13:41:10 dbalab1 sqlservr[6017]: 2017-09-13 13:41:10.21 spid22s The Database Mirroring endpoint is in disabled or stopped state. Sep 13 13:41:10 dbalab1 sqlservr[6017]: 2017-09-13 13:41:10.32 spid22s Service Broker manager has started. Sep 13 13:41:10 dbalab1 sqlservr[6017]: 2017-09-13 13:41:10.46 spid6s Recovery is complete. This is an informational message only. No user action is required. - 检查进程
ps -ef | grep sqlservr | grep -v grep mssql 6017 1 0 13:40 ? 00:00:01 /opt/mssql/bin/sqlservr mssql 6048 6017 8 13:40 ? 00:00:31 /opt/mssql/bin/sqlservr- 检查端口
netstat -tulpn | grep 1433 tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 6048/sqlservr tcp6 0 0 :::1433 :::* LISTEN 6048/sqlservr步骤 4:连接到 SQL Server 实例:
要进行连接,您首先需要安装 mssql-tools(sqlcmd 和 bcp),可以通过执行以下命令来安装:
下载:
curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo安装:
yum install -y mssql-tools unixODBC-develMssq-tools 现已安装,但要使用它们,请将 mssql-tools 二进制文件添加到您的路径中:
export PATH="$PATH:/opt/mssql-tools/bin"如果永久生效,请把mssql-tools 二进制文件加入用户的bash_profile文件或/etc/profile:
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile完成此操作后,您可以通过执行以下命令连接到 SQL Server 实例:-
sqlcmd -S localhost -U SA -P ''第 5 步:现在要允许远程连接(通过您最喜欢的 SSMS 连接),您需要禁用防火墙,这可以通过以下方式实现:
禁用防火墙:
systemctl disable firewalld或者允许端口 1433:
firewall-cmd --zone=public --add-port=1433/tcp --permanent``firewall-cmd --reload第6步:安装SQL Server代理
yum install mssql-server-agent systemctl restart mssql-server版权声明:
作者: FreeClashNode
链接: https://www.freeclashnode.com/news/article-2895.htm
来源: www.freeclashnode.com
文章版权归作者所有,未经允许请勿转载。
热门文章
- 11月2日免费节点分享|22.5M/S,V2ray节点/Clash节点/SSR节点/Singbox节点|免费上网梯子每天更新
- 10月14日免费节点分享|22.5M/S,Clash节点/V2ray节点/Singbox节点/SSR节点|免费上网梯子每天更新
- 10月11日免费节点分享|18.6M/S,V2ray节点/Clash节点/SSR节点/Singbox节点|免费上网梯子每天更新
- 10月13日免费节点分享|22.1M/S,V2ray节点/Clash节点/Singbox节点/Shadowrocket节点|免费上网梯子每天更新
- 10月25日免费节点分享|18.1M/S,SSR节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 10月12日免费节点分享|22.7M/S,Shadowrocket节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 10月10日免费节点分享|18.3M/S,V2ray节点/Singbox节点/Clash节点/SSR节点|免费上网梯子每天更新
- 10月27日免费节点分享|20M/S,Shadowrocket节点/Singbox节点/V2ray节点/Clash节点|免费上网梯子每天更新
- 10月28日免费节点分享|22.8M/S,Singbox节点/SSR节点/V2ray节点/Clash节点|免费上网梯子每天更新
- 10月21日免费节点分享|22M/S,Clash节点/Singbox节点/V2ray节点/SSR节点|免费上网梯子每天更新
最新文章
- 轻松翻越网络高墙:Shadowrocket一键导入配置全攻略
- 11月8日免费节点分享|21.3M/S,Clash节点/V2ray节点/Singbox节点/SSR节点|免费上网梯子每天更新
- 当Vmess突然失效:一场技术与封锁的无声博弈
- 11月7日免费节点分享|22.9M/S,Shadowrocket节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 梅林固件科学上网完全指南:从入门到精通,零成本解锁网络自由
- 11月6日免费节点分享|20.9M/S,Shadowrocket节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 幸运破解器科学上网全解析:解锁数字世界的终极指南
- 11月5日免费节点分享|21.9M/S,Shadowrocket节点/Singbox节点/V2ray节点/Clash节点|免费上网梯子每天更新
- 11月4日免费节点分享|18M/S,Clash节点/Singbox节点/SSR节点/V2ray节点|免费上网梯子每天更新
- 穿越数字迷雾:深度解析V2Ray中转迟滞之谜与极速优化指南
- 跨越数字边界:科学上网的终极指南与深度思考
- 从连接到掌控:深入理解 Quantumult 的工作流程与网络管理哲学
- 11月2日免费节点分享|22.5M/S,V2ray节点/Clash节点/SSR节点/Singbox节点|免费上网梯子每天更新
- 深度解析《荒野冲突》:征服与策略的终极对决
- 11月1日免费节点分享|20.3M/S,V2ray节点/Shadowrocket节点/Clash节点/Singbox节点|免费上网梯子每天更新
- 斐讯路由器刷机配置v2ray全攻略:打造安全高效的翻墙网络环境
- 10月31日免费节点分享|18.7M/S,Shadowrocket节点/Clash节点/V2ray节点/Singbox节点|免费上网梯子每天更新
- 谷歌浏览器科学上网扩展全攻略:从入门到精通
- 10月30日免费节点分享|20.4M/S,V2ray节点/SSR节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 苹果手机V2Ray完全指南:从零开始打造安全上网环境
- 10月29日免费节点分享|21.6M/S,SSR节点/Clash节点/V2ray节点/Singbox节点|免费上网梯子每天更新
- 探索数字世界的门户:电脑科学上网贴吧完全指南
- 10月28日免费节点分享|22.8M/S,Singbox节点/SSR节点/V2ray节点/Clash节点|免费上网梯子每天更新
- 穿越数字边界:科学上网的全面指南与深度思考
- 10月27日免费节点分享|20M/S,Shadowrocket节点/Singbox节点/V2ray节点/Clash节点|免费上网梯子每天更新
- 数字世界的破壁之旅:科学上网全指南与实用工具深度解析
- 10月26日免费节点分享|21.5M/S,V2ray节点/SSR节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 跨越知识边界:浙大学子的全球学术网络探索指南
- 10月25日免费节点分享|18.1M/S,SSR节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 10月24日免费节点分享|20.5M/S,V2ray节点/Clash节点/Singbox节点/Shadowrocket节点|免费上网梯子每天更新
- 刘大猫科学上网全攻略:解锁全球网络的终极指南
- 10月23日免费节点分享|22.2M/S,Shadowrocket节点/Clash节点/Singbox节点/V2ray节点|免费上网梯子每天更新
- 全面解析Quantumult安卓版:功能、安装与配置教程
- 双重防护,畅享无界:AdGuard联手V2RayNG,打造极致安全的上网体验
- 10月22日免费节点分享|18.8M/S,V2ray节点/SSR节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 掌握Clash白名单设置:精准控制代理流量的艺术
- 10月21日免费节点分享|22M/S,Clash节点/Singbox节点/V2ray节点/SSR节点|免费上网梯子每天更新
- 突破网络边界:技术科学上网的终极安全指南
- 10月20日免费节点分享|22.9M/S,SSR节点/V2ray节点/Clash节点/Singbox节点|免费上网梯子每天更新
- Shadowrocket 选购指南:从入门到精通,找到你的专属代理神器
- 10月19日免费节点分享|19.3M/S,Singbox节点/V2ray节点/Clash节点/Shadowrocket节点|免费上网梯子每天更新
- 深入解读:V2Ray为何比SSR更安全?一场网络隐私的全方位较量
- 10月18日免费节点分享|20.6M/S,V2ray节点/Clash节点/SSR节点/Singbox节点|免费上网梯子每天更新
- 深度指南:Shadowrocket从入门到精通——iOS用户的网络自由密钥
- 10月17日免费节点分享|18M/S,Clash节点/SSR节点/V2ray节点/Singbox节点|免费上网梯子每天更新
- 深入解析科学上网套:全方位使用指南与常见问题解答
- 10月16日免费节点分享|22M/S,Shadowrocket节点/V2ray节点/Singbox节点/Clash节点|免费上网梯子每天更新
- 10月15日免费节点分享|21.2M/S,Clash节点/SSR节点/V2ray节点/Singbox节点|免费上网梯子每天更新
- 全局掌控:安卓设备上 Clash 全局模式完整设置指南与深度解析
- 解锁全球游戏体验:育碧平台科学上网全攻略与深度解析
归档
- 2026-11 15
- 2026-10 61
- 2026-09 58
- 2026-08 63
- 2026-07 61
- 2026-06 55
- 2026-05 56
- 2026-04 51
- 2026-03 60
- 2026-02 52
- 2026-01 56
- 2025-12 59
- 2025-11 55
- 2025-10 56
- 2025-09 55
- 2025-08 49
- 2025-07 31
- 2025-06 30
- 2025-05 31
- 2025-04 30
- 2025-03 388
- 2025-02 360
- 2025-01 403
- 2024-12 403
- 2024-11 390
- 2024-10 403
- 2024-09 388
- 2024-08 402
- 2024-07 427
- 2024-06 442
- 2024-05 181
- 2024-04 33
- 2024-03 31
- 2024-02 29
- 2024-01 51
- 2023-12 52
- 2023-11 32
- 2023-10 32
- 2023-09 3