Debian 上 MariaDB 版本选择指南
选择原则
版本矩阵与推荐
| Debian 版本 | 仓库默认 MariaDB | 推荐选择 | 说明 |
|---|---|---|---|
| Debian 10 Buster | 10.3 | 继续使用 10.3(稳定)或升级至 10.6 LTS(官方 APT) | 10.3 为系统默认;10.6 为 LTS,功能更全(如原子 DDL、JSON_TABLE、SKIP LOCKED 等),适合新项目或对特性有要求的场景。 |
| Debian 11 Bullseye | 10.5 | 继续使用 10.5(稳定)或升级至 10.6 LTS(官方 APT) | 10.5 为系统默认;如需新特性/更长支持,选 10.6 LTS。 |
| Debian 12 Bookworm | 11.8 | 优先 11.8(稳定) | 11.8 已提供大量修复与改进,满足生产稳定需求。 |
| Debian 13 Trixie | 11.8 | 优先 11.8(稳定) | 截至 2025-08-13,Trixie 软件源中 MariaDB 仍为 11.8,建议以仓库版本为主。 |
何时考虑新版本或官方仓库
安装与升级要点
sudo apt install mariadb-server 即可安装默认 10.3;安装后运行 sudo mysql_secure_installation 完成安全初始化。curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setupsudo bash mariadb_repo_setup --mariadb-server-version=10.6sudo apt update && sudo apt install mariadb-server mariadb-client
完成后 sudo systemctl start mariadb && sudo systemctl enable mariadb 并检查状态。