How To Install MariaDB 10.4 on Debian 10|9

Posted on 332 views

In this tutorial, I’ll show you how you can install MariaDB 10.4 on Debian 10/9. MariaDB is an open source database server released under the General Public License version 2.  It is a community-developed fork of the MySQL relational database management system built to be fast, robust and with more features.

For CentOS 7  check:

For Ubuntu use:

Install MariaDB 10.4 on Debian 10|9

Before you install MariaDB 10.4 on Debian 10/9, you need to add official MariaDB upstream repositories which contain binary packages for MariaDB.

Step 1: Install dependency packages

Run the following command to install required dependencies:

sudo apt update
sudo apt -y install software-properties-common dirmngr curl wget

Step 2: Add MariaDB 10.4 repository and Import GPG key

Run the command below to import GPG key:

sudo apt-key adv --recv-keys --keyserver 0xF1656F24C74CD1D8

Then configure MariaDB APT repository in your Debian system:

curl -LsS -O
sudo bash mariadb_repo_setup --mariadb-server-version=10.4

Repository command execution output:

[info] Checking for script prerequisites.
[info] Repository file successfully written to /etc/apt/sources.list.d/mariadb.list
[info] Adding trusted package signing keys...
[info] Running apt-get update...
[info] Done adding trusted package signing keys

Step 3: Install MariaDB Database Server 10.4 on 10|9

Once the key is imported and the repository added, you can install MariaDB with:

sudo apt update
sudo apt install mariadb-server mariadb-client

When prompted to set the root password, provide the password.


Confirm root password to set.


When done, it will finish installation and start mysql service. You can check status using:

$ systemctl status mysql
 mariadb.service - MariaDB 10.4.21 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
   Active: active (running) since Wed 2021-10-27 22:27:47 UTC; 2s ago
     Docs: man:mysqld(8)
 Main PID: 4868 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 32 (limit: 1167)
   Memory: 88.2M
   CGroup: /system.slice/mariadb.service
           └─4868 /usr/sbin/mysqld

Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: mysql
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: performance_schema
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: Phase 6/7: Checking and upgrading tables
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: Processing databases
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: information_schema
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: performance_schema
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4908]: OK
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[4999]: Checking for insecure root accounts.
Oct 27 22:27:48 debian10 /etc/mysql/debian-start[5003]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables

You can log in as well to check your database version:

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.21-MariaDB-1:10.4.21+maria~buster-log binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SELECT VERSION();
| VERSION()                                  |
| 10.4.21-MariaDB-1:10.4.21+maria~buster-log |
1 row in set (0.000 sec)

MariaDB [(none)]> QUIT

Step 4: Install Desktop Database Management Tool

If working with MySQL command line is not your thing, then consider installing a Database Tool to help you. Check out our guide below:

That’s all. Enjoy running MariaDB 10.4 on Debian 10/9 Linux server.

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.