Install Upgrade MariaDB 10.8 on Debian 11 Bullseye

Published by

Installing/Upgrading MariaDB 10.8 on Debian 11 Bullseye: A Comprehensive Guide

This guide provides a detailed walkthrough for either installing a fresh instance of MariaDB 10.8 on Debian 11 Bullseye or upgrading an existing installation from version 10.5 without losing any data. It emphasizes the importance of using the official MariaDB repository to avoid potential conflicts and issues that can arise from the default Debian repository.

Why Choose MariaDB 10.8?

Debian 11 comes pre-installed with MariaDB 10.5, which is suitable for basic operations. However, if you require advanced features such as system-versioned tables or new authentication plugins, upgrading to MariaDB 10.8 becomes essential. Users have reported issues where older versions conflict with newer library requirements, making it critical to use the official repository to prevent version mismatches.

Steps to Install/Upgrade MariaDB 10.8

1. Add MariaDB’s Official Repository
- Install necessary packages:
bashsudo apt-get install -y software-properties-common curl gnupg2
- Create a repository file:
bashecho "deb [arch=amd64,arm64] http://mariadb.mirror.nucleus.be/repo/10.8/debian bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list > /dev/null

2. Import the Signing Key
- Download and secure the GPG key:
bashcurl -fsSL https://mariadb.org/mariadb_release_signing_key.asc | sudo gpg --dearmor -o /usr/share/keyrings/mariadb-archive-keyring.gpg
- Associate the key with the repository:
bashecho "Signed-By: /usr/share/keyrings/mariadb-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/mariadb.list > /dev/null

3. Update the Package Index and Install/Upgrade
- Update the package list and install MariaDB:
bashsudo apt update
sudo apt install -y mariadb-server
- If upgrading, the old version will be replaced while keeping your configuration and data intact.

4. Verify the Installation
- Check the installed version:
bashsudo mariadb -u root -p -e "SELECT VERSION();"
- Ensure the service is running:
bashsystemctl status mariadb
- Optionally run `mysql_upgrade` to ensure all system tables are up to date.

Rollback Option

In case of any issues post-upgrade, Debian retains previous packages for a limited duration. You can revert to version 10.5 using:
bashsudo apt install mariadb-server=1:10.5.* mariadb-client=1:10.5.*
To prevent future automatic upgrades, remove the MariaDB repository file.

Conclusion

Following this guide, you should now have a fully functioning MariaDB 10.8 installation on Debian 11 Bullseye, free from the complications often associated with version mismatches. This process not only enhances your database capabilities but also ensures a smoother and more stable operating environment. Consider regularly checking for updates and best practices to keep your database secure and efficient

Install Upgrade MariaDB 10.8 on Debian 11 Bullseye

A step‑by‑step guide walks you through adding MariaDB’s official repository to Debian 11 Bullseye and pulling in version 10.8, bypassing the older 10.5 shipped with the distro. It explains why importing the correct GPG key matters, how to upgrade an existing installation without losing data, and how to verify the new server is running. 

Install Upgrade MariaDB 10.8 on Debian 11 Bullseye @ Linux Compatible