👋 欢迎来到 LibraryStudio

记录Linux、数据库、后端开发的技术笔记。

如何在 Linux 下安装 MS SQL Server

本文参考了 https://learn.microsoft.com/zh-cn/sql/linux/install-upgrade/quickstart-install-ubuntu 适用于:SQL Server 2025 (17.x) CU 1 及更高版本。 步骤: 下载公钥,将其从 ASCII 转换为 GPG 格式,并将其写入所需位置: curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg 手动下载并注册 SQL Server Ubuntu 存储库: curl -fsSL https://packages.microsoft.com/config/ubuntu/24.04/mssql-server-2025.list | sudo tee /etc/apt/sources.list.d/mssql-server-2025.list 安装 SQL Server: sudo apt-get update sudo apt-get install -y mssql-server 包安装完成后,运行 mssql-conf setup,按照提示设置 sa 密码并选择版本。 以下 SQL Server 版本获自由许可:评估版、开发人员版和 Express 版。 sudo /opt/mssql/bin/mssql-conf setup 一开始会显示出版本列表: Choose an edition of SQL Server: 1) Evaluation (free, no production use rights, 180-day limit) 2) Enterprise Developer (free, no production use rights) 3) Standard Developer (free, no production use rights) 4) Express (free) 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. 9) Standard (Billed through Azure) - Use pay-as-you-go billing through Azure. 10) Enterprise Core (Billed through Azure) - Use pay-as-you-go billing through Azure. Details about editions can be found at https://go.microsoft.com/fwlink/?LinkId=2109348 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. By choosing an edition billed Pay-As-You-Go through Azure, you are verifying that the server and SQL Server will be connected to Azure by installing the management agent and Azure extension for SQL Server. Enter your edition(1-10): 一般我们开发选 3 即可。 ...

2026年09月21日 · 谢涛