Blocking ads removes funding from us!
Researching and writing articles takes a lot of time. Operating our infrastructure costs money.
All of this is funded with advertising revenue.
We don't like advertising either - that's why we avoid annoying banners and pop-ups.
Please give us a chance and deactivate your adblocker!
Alternatively, you can support us here voluntarily.
Language:  Deutsch English (Beta)

Follow us:

Upgrade from MySQL 5.x to MariaDB 10.x under Debian / Ubuntu - this is how it works!

MariaDB logo
Image: MariaDB
(Post picture: © 2021 MariaDB)

The open source world of MySQL is currently switching more and more to MariaDB. Some users are now faced with the question of how the switch is possible. In this guide we show how a MySQL 5 database can be easily exchanged for MariaDB 10.

A little background: After Oracle announced controversial license changes with MySQL 8, more and more supporters of open source software are withdrawing from the database hirschen. Future versions of MySQL are to be developed “closed” - exactly the opposite of open source. For this reason, for example, the popular Linux distributions Debian and Ubuntu in their current versions also include MariaDB as standard instead of MySQL.

Is the Plesk administration tool running on the server? Then the steps for the upgrade are a little different. Then please work through the following guide:

It's that easy to upgrade from MySQL 5.x to MariaDB 10.x.

  1. Create a backup! the Database tables, at best the entire server, should be backed up before the upgrade, as an upgrade can sometimes go wrong.
  2. So that we can start, MySQL has to be updated to the latest version (5.7), but at least to 5.5. This happens with the usual commands:
    sudo apt-get update
    sudo apt-get upgrade
  3. Check database version - In the best case scenario, MySQL should now run on version 5.7:
  4. This command should give the following, similar result:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 2187338
    Server version: 5.7.35-0ubuntu0.21.04.1 (Ubuntu)
  5. Add MariaDB repository - auf dieser seite choose the Debian or Ubuntu version used. Then the commands displayed must be carried out. For example the following for a server with Ubuntu 21.04 ("hirsute") and a desired upgrade to MariaDB 10.7:
    sudo apt-get install software-properties-common dirmngr apt-transport-https
    sudo apt-key adv – fetch-keys ''
    sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] hirsute main'
  6. Shut down the MySQL server (on older systems the service may still be called "mysqld"):
    sudo service mysql stop
  7. If the repository and the key from above have been added successfully, the installation of MariaDB will now be carried out. This will remove the old MySQL packages, that's fine.
    sudo apt update
    sudo apt install mariadb-server
  8. Upgrade the database tables on MariaDB:
  9. Then check that MariaDB has been installed properly. Run the following command:
  10. This should deliver the following, similar result:
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 473
    Server version: 10.7.1-MariaDB-1:10.7.1+maria~hirsute binary distribution
  11. It is now advisable to check whether all services and websites connected to the database can be reached. Normally, all services compatible with MySQL 5.5-5.7 should work with MariaDB 10 as well. This guarantee is no longer given for future versions of MariaDB.

Upgrade from MySQL 8.x to MariaDB 10.x

MariaDB 10.x is a "drop-in" replacement, but only for MySQL versions 5.5 to 5.7. This means that no migration work is necessary afterwards. Future versions of MySQL and MariaDB will differ technically in some points and will no longer be easily replaceable. So if you have already updated to MySQL 8, you have to back up all database tables manually and migrate them to MariaDB. Unfortunately this is the only way, also vice versa (from MariaDB 10.x to MySQL 8.x). There is further support in one Instructions at MariaDB.

Recommendations for you

>> Support us by purchasing from Amazon <

David Wurm

Do that TechnikNews-Ding together with a great team for several years. Works in the background on the server infrastructure and is also responsible for everything editorial. Is fascinated by current technology and likes to blog about everything digital. In his free time, he can often be found developing websites, taking photos or making radio.

David has already written 870 articles and left 349 comments.

Web | Facebook | Twitter | Insta | YouTube
Mail: david.wurm | at | | please NOT for general inquiries, cooperations! This way: Contact
Your name, which will be shown publicly.
We will not publish your email address.
Inline feedback
View all comments