How can I quickly install MariaDB 10.5 on Oracle Linux 8 / Rocky Linux 8?. MariaDB is a free and open-source relational database management system forked from MySQL and community-developed. The database software is released under the GNU General Public License. Our short tutorial will teach you how to install and configure MariaDB 10.5 on Oracle Linux 8 | Rocky Linux 8 Linux system.

Install MariaDB 10.5 on Oracle Linux 8 / Rocky Linux 8

You should have a running Oracle / Rocky Linux server before you start the installation. This can be a physical server, virtual machine running on VMware, KVM, OpenStack or cloud provider such as AWS. A user that has sudo privileges is also required for the installation.

Step 1: Update System

Run the command below to pull the latest packages of the applications installed in your system.

$ sudo dnf update
Dependencies resolved.
 Package                                   Architecture             Version                                   Repository                           Size
 kernel                                    x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.8 M
 kernel-core                               x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                    28 M
 kernel-modules                            x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                    23 M
 bind-export-libs                          x86_64                   32:9.11.13-5.el8_2                        ol8_baseos_latest                   1.1 M
 bind-libs                                 x86_64                   32:9.11.13-5.el8_2                        ol8_appstream                       171 k
 bind-libs-lite                            x86_64                   32:9.11.13-5.el8_2                        ol8_appstream                       1.2 M
 bind-license                              noarch                   32:9.11.13-5.el8_2                        ol8_appstream                       100 k
 bind-utils                                x86_64                   32:9.11.13-5.el8_2                        ol8_appstream                       443 k
 bpftool                                   x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   3.4 M
 gnutls                                    x86_64                   3.6.8-10.el8_2                            ol8_baseos_latest                   915 k
 iproute                                   x86_64                   5.4.0-1.0.1.el8                           ol8_UEKR6                           665 k
 kernel-tools                              x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.9 M
 kernel-tools-libs                         x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.8 M
 nftables                                  x86_64                   1:0.9.3-12.0.1.el8                        ol8_baseos_latest                   311 k
 oraclelinux-release                       x86_64                   8:8.2-1.0.8.el8                           ol8_baseos_latest                    66 k
 python3-bind                              noarch                   32:9.11.13-5.el8_2                        ol8_appstream                       148 k
 python3-nftables                          x86_64                   1:0.9.3-12.0.1.el8                        ol8_baseos_latest                    25 k
 python3-perf                              x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.9 M
 selinux-policy                            noarch                   3.14.3-41.0.1.el8_2.2                     ol8_baseos_latest                   615 k
 selinux-policy-targeted                   noarch                   3.14.3-41.0.1.el8_2.2                     ol8_baseos_latest                    15 M
 systemd                                   x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   3.5 M
 systemd-libs                              x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   1.1 M
 systemd-pam                               x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   450 k
 systemd-udev                              x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   1.3 M
 tzdata                                    noarch                   2020a-1.el8                               ol8_baseos_latest                   469 k
 xfsprogs                                  x86_64                   5.4.0-1.el8                               ol8_UEKR6                           1.1 M

Transaction Summary
Install   3 Packages
Upgrade  23 Packages

Total download size: 95 M
Is this ok [y/N]: y

If you get kernel updates, consider performing a reboot.

sudo reboot

Step 2: Add MariaDB repository

Add MariaDB repository to your Oracle Linux 8 / Rocky Linux 8.

sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF 
name = MariaDB
baseurl =

Repository contents will be added to /etc/yum.repos.d/MariaDB.repo file.

$ cat /etc/yum.repos.d/MariaDB.repo
name = MariaDB
baseurl =

Step 3: Install MariaDB 10.5 on Oracle Linux 8

Run the dnf command with install option to pull MariaDB 10.5 packages on Oracle / Rocky Linux 8.

sudo dnf install boost-program-options
sudo dnf install MariaDB-server MariaDB-client --disablerepo=ol8_appstream 

Confirm the version being installed is 10.5.

Dependencies resolved.
 Package                                   Architecture              Version                                 Repository                            Size
 MariaDB-client                            x86_64                    10.5.13-1.el8                           mariadb                               12 M
 MariaDB-server                            x86_64                    10.5.13-1.el8                           mariadb                               26 M
Installing dependencies:
 MariaDB-common                            x86_64                    10.5.13-1.el8                           mariadb                               87 k
 MariaDB-shared                            x86_64                    10.5.13-1.el8                           mariadb                              115 k
 galera-4                                  x86_64                    26.4.4-1.rhel8.0.el8                    mariadb                               13 M
 perl-Carp                                 noarch                    1.42-396.el8                            ol8_baseos_latest                     30 k
 perl-DBI                                  x86_64                    1.641-1.el8                             ol8_baseos_latest                    740 k
 perl-Data-Dumper                          x86_64                    2.167-399.el8                           ol8_baseos_latest                     58 k
 perl-Encode                               x86_64                    4:2.97-3.el8                            ol8_baseos_latest                    1.5 M
 perl-Errno                                x86_64                    1.28-416.el8                            ol8_baseos_latest                     76 k
 perl-Exporter                             noarch                    5.72-396.el8                            ol8_baseos_latest                     34 k
 perl-File-Path                            noarch                    2.15-2.el8                              ol8_baseos_latest                     38 k
 perl-File-Temp                            noarch                    0.230.600-1.el8                         ol8_baseos_latest                     63 k
 perl-Getopt-Long                          noarch                    1:2.50-4.el8                            ol8_baseos_latest                     63 k
 perl-HTTP-Tiny                            noarch                    0.074-1.el8                             ol8_baseos_latest                     58 k
 perl-IO                                   x86_64                    1.38-416.el8                            ol8_baseos_latest                    141 k
 perl-MIME-Base64                          x86_64                    3.15-396.el8                            ol8_baseos_latest                     31 k
 perl-Math-BigInt                          noarch                    1:1.9998.11-7.el8                       ol8_baseos_latest                    196 k
 perl-Math-Complex                         noarch                    1.59-416.el8                            ol8_baseos_latest                    108 k
 perl-PathTools                            x86_64                    3.74-1.el8                              ol8_baseos_latest                     90 k
 perl-Pod-Escapes                          noarch                    1:1.07-395.el8                          ol8_baseos_latest                     20 k
 perl-Pod-Perldoc                          noarch                    3.28-396.el8                            ol8_baseos_latest                     88 k
 perl-Pod-Simple                           noarch                    1:3.35-395.el8                          ol8_baseos_latest                    213 k
 perl-Pod-Usage                            noarch                    4:1.69-395.el8                          ol8_baseos_latest                     34 k
 perl-Scalar-List-Utils                    x86_64                    3:1.49-2.el8                            ol8_baseos_latest                     68 k
 perl-Socket                               x86_64                    4:2.027-3.el8                           ol8_baseos_latest                     59 k
 perl-Storable                             x86_64                    1:3.11-3.el8                            ol8_baseos_latest                     98 k
 perl-Term-ANSIColor                       noarch                    4.06-396.el8                            ol8_baseos_latest                     46 k
 perl-Term-Cap                             noarch                    1.17-395.el8                            ol8_baseos_latest                     23 k
 perl-Text-ParseWords                      noarch                    3.30-395.el8                            ol8_baseos_latest                     18 k
 perl-Text-Tabs+Wrap                       noarch                    2013.0523-395.el8                       ol8_baseos_latest                     24 k
 perl-Time-Local                           noarch                    1:1.280-1.el8                           ol8_baseos_latest                     33 k
 perl-Unicode-Normalize                    x86_64                    1.25-396.el8                            ol8_baseos_latest                     82 k
 perl-constant                             noarch                    1.33-396.el8                            ol8_baseos_latest                     25 k
 perl-interpreter                          x86_64                    4:5.26.3-416.el8                        ol8_baseos_latest                    6.3 M
 perl-libs                                 x86_64                    4:5.26.3-416.el8                        ol8_baseos_latest                    1.6 M
 perl-macros                               x86_64                    4:5.26.3-416.el8                        ol8_baseos_latest                     72 k
 perl-parent                               noarch                    1:0.237-1.el8                           ol8_baseos_latest                     20 k
 perl-podlators                            noarch                    4.11-1.el8                              ol8_baseos_latest                    118 k
 perl-threads                              x86_64                    1:2.21-2.el8                            ol8_baseos_latest                     61 k
 perl-threads-shared                       x86_64                    1.58-2.el8                              ol8_baseos_latest                     48 k

Transaction Summary
Install  41 Packages

Total download size: 64 M
Installed size: 283 M
Is this ok [y/N]: y

Start and enable mariadb service:

sudo systemctl enable --now mariadb

Confirm service status is in running state.

$ systemctl status mariadb
● mariadb.service - MariaDB 10.5.13 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 Sun 2020-06-07 19:51:38 UTC; 5s ago
     Docs: man:mysqld(8)
  Process: 7219 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 7178 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   &>
  Process: 7176 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 7188 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 5047)
   Memory: 108.8M
   CGroup: /system.slice/mariadb.service
           └─7188 /usr/sbin/mysqld

Step 4: Secure MariaDB 10.5 on Oracle Linux 8 / Rocky Linux 8

Run the database hardening script to remove test database and set root password.

$ sudo mysql_secure_installation


In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): <ENTER>
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password: <INPUT-PASSWORD>
Re-enter new password: <CONFIRM-PASSWORD>
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

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

Thanks for using MariaDB!

Login as root use to check if set password is working:

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.5.13-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)]> SELECT VERSION();
| VERSION()       |
| 10.5.13-MariaDB |
1 row in set (0.000 sec)

MariaDB [(none)]> QUIT

Best MySQL Udemy Video courses:

More on Oracle Linux:

How To Install Vagrant on Oracle Linux

How To Install MySQL 8.0 on Oracle Linux

Install PHP 7.x on Oracle Linux


Please enter your comment!
Please enter your name here