You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 23.10下使用SQL Server的可行方案及替代方案咨询

Ubuntu 23.10下使用SQL Server的可行方案及替代方案咨询

Hey there, totally get it—having to boot back to Windows just to practice SQL is such a hassle, especially when you're in the middle of learning. Let's break down your options:

尝试在Ubuntu 23.10安装SQL Server(非官方支持,仅用于测试学习)

Since Microsoft only officially supports Ubuntu 20.04 and 22.04, you can try a workaround by forcing the use of the 22.04 repository. Keep in mind this might have compatibility issues, so don't use it for production:

  • First, import Microsoft's GPG key:
    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
    
  • Add the Ubuntu 22.04 SQL Server repository:
    echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy main" | sudo tee /etc/apt/sources.list.d/mssql-server.list
    
  • Update your apt cache and install:
    sudo apt update
    sudo apt install -y mssql-server
    
  • Run the setup script to configure your instance:
    sudo /opt/mssql/bin/mssql-conf setup
    

If you hit dependency errors or stability issues later, don't be surprised—this is an unsupported setup after all.

更稳妥的替代方案(适合SQL学习)

If you want something reliable without the hassle of unsupported setups, these options are perfect for learning:

  • MySQL/MariaDB: Super popular open-source database with syntax very close to SQL Server. It's in Ubuntu's official repos, so installation is a breeze:
    sudo apt install mariadb-server
    
    It's great for learning core SQL concepts, and you'll find tons of learning resources online.
  • PostgreSQL: A powerful, standards-compliant open-source database. It's widely used in enterprises and supports advanced SQL features. Install it with:
    sudo apt install postgresql postgresql-contrib
    
    Perfect if you want to go beyond basic SQL and explore more advanced topics.
  • SQLite: A lightweight, file-based database that doesn't require a server. It's perfect for quickly testing SQL snippets on the fly. Ubuntu usually has it pre-installed, but if not:
    sudo apt install sqlite3
    
    Just type sqlite3 in your terminal to start writing SQL immediately.
  • Dockerized SQL Server: This is my top recommendation for learning SQL Server specifically. It uses an official container image, so it's fully supported and isolated from your system:
    1. Install Docker first:
      sudo apt install docker.io
      sudo systemctl start docker && sudo systemctl enable docker
      
    2. Pull the official SQL Server 2022 image:
      sudo docker pull mcr.microsoft.com/mssql/server:2022-latest
      
    3. Run the container (replace YourStrong!Passw0rd with a secure password):
      sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong!Passw0rd" -p 1433:1433 --name sqlserver -d mcr.microsoft.com/mssql/server:2022-latest
      
    You can connect to it just like a regular SQL Server instance, and you can stop/start the container anytime without messing with your system.

No worries about your English at all—your question was clear and easy to understand!

备注:内容来源于stack exchange,提问作者Duy Nguyễn Hoàng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 11:45:29