Installing MariaDB 10.6.5 Community Server on Red Hat Enterprise Linux release 8.5

In this article, we are installing MariaDB Community Edition on Red Hat Enterprise. In a previous one, we saw how to register and attach the Red Hat system.

MariaDB 10.6.5 GA can be downloaded from here

MariaDB Community Server: Lightweight but powerful, innovative but mature, and 100% open source

Red Hat can be downloaded from here

The Red Hat Developer program provides easy access to Red Hat Enterprise Linux, a secure, stable, and supported OS.

Creating an User and group:

MariaDB should never normally be run as the system's root user, therefore, a better practice is to use a separate user, exclusively used for MariaDB.

So we create a new group called dba, an user called dbuser and then we add the user to the wheel group, which has sudo access by default.

PS: This installation is for testing purposes.

[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g dba -m dbuser
[root@localhost ~]# usermod -aG wheel dbuser

Installing MariaDB with yum

Using WinSCP, we upload the MariaDB installation file and then we extract it using tar. If tar is not installed just run: yum install tar.

[root@localhost ~]# tar xf mariadb-10.6.5-rhel-8-x86_64-rpms.tar
[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]# ls -lrt
total 796840
-rw-r--r--. 1 dbuser dba   7299148 Nov  6 23:15 MariaDB-backup-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  55959612 Nov  6 23:15 MariaDB-backup-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  15100248 Nov  6 23:15 MariaDB-client-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   7716840 Nov  6 23:15 MariaDB-columnstore-engine-10.6.5_6.2.1-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  59932940 Nov  6 23:15 MariaDB-client-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     15236 Nov  6 23:15 MariaDB-gssapi-server-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     17920 Nov  6 23:15 MariaDB-devel-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   8330532 Nov  6 23:15 MariaDB-devel-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     46164 Nov  6 23:15 MariaDB-cracklib-password-check-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     12412 Nov  6 23:15 MariaDB-cracklib-password-check-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   3672320 Nov  6 23:15 MariaDB-connect-engine-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   2720720 Nov  6 23:15 MariaDB-connect-engine-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   2262524 Nov  6 23:15 MariaDB-compat-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba    204196 Nov  6 23:15 MariaDB-common-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     90048 Nov  6 23:15 MariaDB-common-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba 121412040 Nov  6 23:15 MariaDB-columnstore-engine-debuginfo-10.6.5_6.2.1-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   6019364 Nov  6 23:15 MariaDB-rocksdb-engine-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   1435060 Nov  6 23:15 MariaDB-oqgraph-engine-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     79124 Nov  6 23:15 MariaDB-oqgraph-engine-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba     62520 Nov  6 23:15 MariaDB-gssapi-server-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba   4145536 Nov  6 23:15 MariaDB-s3-engine-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba    927652 Nov  6 23:15 MariaDB-s3-engine-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba 101236752 Nov  6 23:15 MariaDB-rocksdb-engine-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  26348772 Nov  6 23:15 MariaDB-server-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba    458796 Nov  6 23:15 MariaDB-shared-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba    118096 Nov  6 23:15 MariaDB-shared-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba 120934600 Nov  6 23:15 MariaDB-server-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  41651316 Nov  6 23:15 MariaDB-test-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba 130450972 Nov  6 23:15 MariaDB-test-debuginfo-10.6.5-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  13643640 Nov  6 23:15 galera-4-26.4.9-1.el8.x86_64.rpm
-rw-r--r--. 1 dbuser dba  83578300 Nov  6 23:15 MariaDB-10.6.5-1.el8.src.rpm
-rwxrwxr-x. 1 dbuser dba      1054 Nov  6 23:16 setup_repository
drwxrwxr-x. 2 dbuser dba      4096 Nov  6 23:16 repodata
-rw-rw-r--. 1 dbuser dba      1706 Nov  6 23:16 README
[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]#

To setup the MariaDB repository, run setup_repository.

[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]# ./setup_repository
Repository file successfully created! Please install MariaDB Server with this command:

   yum install MariaDB-server

To install MariaDB execute the following.

[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]# yum install MariaDB-server
Updating Subscription Management repositories.
MariaDB            
Dependencies resolved.
.
.
.
Is this ok [y/N]:
.
.
.
Complete!
[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]#

and now we can switch user to our newly created user dbuser and start MariaDB using systemctl.

[root@localhost mariadb-10.6.5-rhel-8-x86_64-rpms]# su - dbuser

[dbuser@localhost ~]$ sudo systemctl start mariadb

[dbuser@localhost ~]$ sudo systemctl status mariadb
● mariadb.service - MariaDB 10.6.5 database server
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Wed 2022-01-19 20:13:00 GMT; 1s ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 38263 (mariadbd)
   Status: "Taking your SQL requests now..."
    Tasks: 10 (limit: 23679)
   Memory: 66.8M
   CGroup: /system.slice/mariadb.service
           └─38263 /usr/sbin/mariadbd

and connect to it.

[dbuser@localhost ~]$ sudo mariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.5-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.

and check the status and version (10.6.5-MariaDB)

MariaDB [(none)]> status
--------------
mariadb  Ver 15.1 Distrib 10.6.5-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:          3
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.6.5-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8mb3
Conn.  characterset:    utf8mb3
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 59 sec

Threads: 1  Questions: 4  Slow queries: 0  Opens: 18  Open tables: 11  Queries per second avg: 0.067
--------------

MariaDB [(none)]>