How To Install MariaDB 10.4 on Fedora 32/31/30/29

Posted on 323 views

This guide will discuss the steps required to install MariaDB 10.4 on Fedora 32/31/30/29. MariaDB is a widely used relational database server that is community-developed, forked from MySQL relational database management system.

MariaDB is an open-source and free software released under the General Public License version 2. The latest stable release as of this article writing is version 10.4. The MariaDB packages are distributed as binaries on mariadb.org. But you also have an option to build it from source should you choose to do so.

So let’s start to install MariaDB 10.4 on Fedora 32/31/30/29.

Step 1: Update Fedora machine

Let’s make sure we’re running the latest versions of Fedora packages in our system.

sudo dnf -y update

Reboot the server after upgrade.

sudo systemctl reboot

Step 2: Add MariaDB RPM repository

Now add the MariaDB RPM repository to your system.

Fedora 32/31/30:

sudo tee /etc/yum.repos.d/mariad.repo<

Fedora 29:

sudo tee /etc/yum.repos.d/mariad.repo<

Step 3: Install MariaDB 10.4 on Fedora 32/31/30/29

Now install MariaDB 10.4 on Fedora 32/31/30/29 Linux system.

sudo dnf -y install MariaDB-server

Below is the dependency tree and list of packages to be installed.

Dependencies resolved.
===================================================================================================================================================
 Package                                    Architecture               Version                                   Repository                   Size
===================================================================================================================================================
Installing:
 MariaDB-server                             x86_64                     10.4.8-1.fc30                             mariadb                      25 M
Installing dependencies:
 boost-program-options                      x86_64                     1.69.0-9.fc31                             fedora                      161 k
 libaio                                     x86_64                     0.3.111-6.fc31                            fedora                       24 k
 lsof                                       x86_64                     4.93.2-2.fc31                             fedora                      240 k
 perl-Carp                                  noarch                     1.50-439.fc31                             fedora                       29 k
 perl-DBI                                   x86_64                     1.642-5.fc31                              fedora                      701 k
 perl-Data-Dumper                           x86_64                     2.174-440.fc31                            fedora                       57 k
 perl-Digest                                noarch                     1.17-439.fc31                             fedora                       24 k
 perl-Digest-MD5                            x86_64                     2.55-439.fc31                             fedora                       36 k
 perl-Encode                                x86_64                     4:3.01-439.fc31                           fedora                      1.8 M
 perl-Errno                                 x86_64                     1.30-446.fc31                             fedora                       25 k
 perl-Exporter                              noarch                     5.73-440.fc31                             fedora                       32 k
 perl-File-Path                             noarch                     2.16-439.fc31                             fedora                       36 k
 perl-File-Temp                             noarch                     1:0.230.900-439.fc31                      fedora                       60 k
 perl-Getopt-Long                           noarch                     1:2.51-1.fc31                             fedora                       60 k
 perl-HTTP-Tiny                             noarch                     0.076-439.fc31                            fedora                       55 k
 perl-IO                                    x86_64                     1.40-446.fc31                             fedora                       92 k
 perl-MIME-Base64                           x86_64                     3.15-439.fc31                             fedora                       30 k
 perl-Math-BigInt                           noarch                     1:1.9998.16-439.fc31                      fedora                      185 k
 perl-Math-Complex                          noarch                     1.59-446.fc31                             fedora                       57 k
 perl-Net-SSLeay                            x86_64                     1.88-3.fc31                               fedora                      355 k
 perl-PathTools                             x86_64                     3.78-439.fc31                             fedora                       86 k
 perl-Pod-Escapes                           noarch                     1:1.07-439.fc31                           fedora                       20 k
 perl-Pod-Perldoc                           noarch                     3.28.01-442.fc31                          fedora                       85 k
 perl-Pod-Simple                            noarch                     1:3.39-2.fc31                             fedora                      214 k
 perl-Pod-Usage                             noarch                     4:1.69-439.fc31                           fedora                       32 k
 perl-Scalar-List-Utils                     x86_64                     3:1.52-439.fc31                           fedora                       66 k
 perl-Socket                                x86_64                     4:2.029-4.fc31                            fedora                       56 k
 perl-Storable                              x86_64                     1:3.15-441.fc31                           fedora                       97 k
 perl-Term-ANSIColor                        noarch                     4.06-440.fc31                             fedora                       44 k
 perl-Term-Cap                              noarch                     1.17-439.fc31                             fedora                       22 k
 perl-Text-ParseWords                       noarch                     3.30-439.fc31                             fedora                       16 k
 perl-Text-Tabs+Wrap                        noarch                     2013.0523-439.fc31                        fedora                       23 k
 perl-Time-Local                            noarch                     2:1.280-439.fc31                          fedora                       32 k
 perl-URI                                   noarch                     1.76-5.fc31                               fedora                      108 k
 perl-Unicode-Normalize                     x86_64                     1.26-439.fc31                             fedora                       97 k
 perl-constant                              noarch                     1.33-440.fc31                             fedora                       23 k
 perl-interpreter                           x86_64                     4:5.30.0-446.fc31                         fedora                      6.1 M
 perl-libnet                                noarch                     3.11-440.fc31                             fedora                      117 k
 perl-libs                                  x86_64                     4:5.30.0-446.fc31                         fedora                      1.7 M
 perl-macros                                x86_64                     4:5.30.0-446.fc31                         fedora                       21 k
 perl-parent                                noarch                     1:0.237-439.fc31                          fedora                       14 k
 perl-podlators                             noarch                     1:4.12-2.fc31                             fedora                      113 k
 perl-threads                               x86_64                     1:2.22-439.fc31                           fedora                       58 k
 perl-threads-shared                        x86_64                     1.60-440.fc31                             fedora                       44 k
 MariaDB-client                             x86_64                     10.4.8-1.fc30                             mariadb                      11 M
 MariaDB-common                             x86_64                     10.4.8-1.fc30                             mariadb                      81 k
 galera-4                                   x86_64                     26.4.2-1.fc30.fc30                        mariadb                      14 M
Installing weak dependencies:
 perl-IO-Socket-IP                          noarch                     0.39-440.fc31                             fedora                       42 k
 perl-IO-Socket-SSL                         noarch                     2.066-6.fc31                              fedora                      239 k
 perl-Mozilla-CA                            noarch                     20180117-6.fc31                           fedora                       12 k

Transaction Summary
===================================================================================================================================================
Install  51 Packages

Total download size: 64 M
Installed size: 237 M
Downloading Packages:

Step 4: Configure MariaDB service on Fedora 32/31/30/29

After installation of MariaDB 10.4 on Fedora 31/30/29, start the service and set it to start at system boot.

sudo systemctl enable --now mariadb

Check service status:

$ systemctl status mariadb
● mariadb.service - MariaDB 10.4.8 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Sun 2019-11-03 07:13:45 UTC; 8s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3671 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 3672 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl>
  Process: 3712 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 3681 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 2345)
   Memory: 63.2M
      CPU: 189ms
   CGroup: /system.slice/mariadb.service
           └─3681 /usr/sbin/mysqld

Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] InnoDB: 10.4.8 started; log sequence number 139827; transac>
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffe>
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] Server socket created on IP: '::'.
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] InnoDB: Buffer pool(s) load completed at 191103  7:13:45
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] Reading of all Master_info entries succeeded
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] Added new Master_info '' to hash table
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: 2019-11-03  7:13:45 0 [Note] /usr/sbin/mysqld: ready for connections.
Nov 03 07:13:45 fed31.computingforgeeks.com mysqld[3681]: Version: '10.4.8-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Serv>
Nov 03 07:13:45 fed31.computingforgeeks.com systemd[1]: Started MariaDB 10.4.8 database server.

Harden you MariaDB server installation.

$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

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): 
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: 
Re-enter new 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!

Use the root user and password set to access MariaDB shell:

$ 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.4.8-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.

Version installed can be checked from the DB shell.

MariaDB [(none)]> SELECT VERSION();
+----------------+
| VERSION()      |
+----------------+
| 10.4.8-MariaDB |
+----------------+
1 row in set (0.000 sec)

This confirms successful installation of MariaDB 10.4 on Fedora 31/30/29 Linux system.

coffee

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