How To Install MariaDB 10.8 on Centos 7

In this tutorial, we intend to teach you How To Install MariaDB 10.8 on Centos 7.

MariaDB is an open-source relational database management system (DBMS) that is a compatible drop-in replacement for the widely used MySQL database technology.

MariaDB is based on SQL and supports ACID-style data processing with guaranteed atomicity, consistency, isolation, and durability for transactions. Among other features, the database also supports JSON APIs, parallel data replication, and multiple storage engines, including InnoDB, MyRocks, Spider, Aria, TokuDB, Cassandra, and MariaDB ColumnStore.

How To Install MariaDB 10.8 on Centos 7

To install MariaDB 10.8, you must log in to your server as a non-root user with sudo privileges. To do this, you can check our guide the Initial Server Setup with Centos 7.

Now follow the steps below to complete this guide.

Steps To Install MariaDB 10.8 on Centos 7

To install MariaDB 10.8, you need to add the new MariaDB repository to your server.

Create MariaDB Repository on Centos

First, create a repository file with your favorite text editor, here we use vi:

sudo vi /etc/yum.repos.d/MariaDB.repo

Add the following content to your file:

name = MariaDB
baseurl =

When you are done, save and close the file.

Install MariaDB on Centos

Then, you can use the following command to install MariaDB 10.8 on your server:

sudo yum install MariaDB-server MariaDB-client -y

Manage MariaDB Service

Once your installation is completed, start and enable your MariaDB service to start on boot, with the following commands:

# sudo systemctl start mariadb
# sudo systemctl enable mariadb

At this point, verify that your MariaDB service is active and running on your Centos 7:

sudo systemctl status mariadb
● mariadb.service - MariaDB 10.8.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
Active: active (running) since Wed 2022-06-22 07:30:34 EDT; 47s ago
Docs: man:mariadbd(8)
Main PID: 22371 (mariadbd)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─22371 /usr/sbin/mariadbd

Howe To Run MariaDB Secure Script on Centos

At this point, that you have MariaDB installed on your server, you need to secure your MariaDB by setting a root password, disabling remote root login, removing the test database as well as anonymous users, and finally reloading privileges.

To do this, run the following script:

sudo mariadb-secure-installation
Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n] n
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Also, you can verify your MariaDB 10.8 installation by checking its version:

mysql -V
mysql Ver 15.1 Distrib 10.8.3-MariaDB, for Linux (x86_64) using readline 5.1

Finally, you can access your MariaDB shell with the following command:

sudo 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.8.3-MariaDB MariaDB Server

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)]>

For more information, you can visit the MariaDB Documentation page.


At this point, you learn to Install MariaDB 10.8 on Centos 7.

Hope you enjoy using it.

Also, if you have an older version of MariaDB and want to upgrade it to a new version, you can check our guide on How To Upgrade MariaDB on Centos 7.

You may be like these articles:

How To Install MariaDB 10.9 on AlmaLinux 9

How To Install MariaDB 10.9 on Ubuntu 20.04

Install MariaDB 10.8 on Debian 11

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!