Friday, November 15, 2024
Google search engine
HomeData Modelling & AIHow To Install MariaDB 10.4 on Debian 10|9

How To Install MariaDB 10.4 on Debian 10|9

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 / Debian 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

Configure MariaDB APT repository in your Debian system:

curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
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.

install mariadb 10.4 debian 9 debian 8 01

Confirm root password to set.

install mariadb 10.4 debian 9 debian 8 02

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

$ systemctl status mysql
 mariadb.service - MariaDB 10.4.28 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2023-03-07 15:43:10 UTC; 3min 40s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 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

Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: mysql
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: performance_schema
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: Phase 6/7: Checking and upgrading tables
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: Processing databases
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: information_schema
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: performance_schema
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4908]: OK
Mar 07 15:43:10 debian10 /etc/mysql/debian-start[4999]: Checking for insecure root accounts.
Mar 07 15:43:10 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.28-MariaDB-1:10.4.28+maria~deb10-log mariadb.org 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.28-MariaDB-1:10.4.28+maria~deb10-log |
+-------------------------------------------+
1 row in set (0.000 sec)

MariaDB [(none)]> QUIT
Bye

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.

RELATED ARTICLES

Most Popular

Recent Comments