Tuesday, November 26, 2024
Google search engine
HomeData Modelling & AIHow To Install MariaDB 10.4 on Fedora 33/32/31/30

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

This guide will discuss the steps required to install MariaDB 10.4 on Fedora. 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 33/32/31/30.

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 33

sudo tee /etc/yum.repos.d/mariad.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/fedora33-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

Fedora 32:

sudo tee /etc/yum.repos.d/mariad.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/fedora32-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

Fedora 31:

sudo tee /etc/yum.repos.d/mariad.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/fedora31-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

Fedora 30:

sudo tee /etc/yum.repos.d/mariad.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/fedora30-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

Step 3: Install MariaDB 10.4 on Fedora

Now install MariaDB 10.4 on Fedora Linux system.

sudo dnf -y install MariaDB-server

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

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

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

Step 4: Configure MariaDB service on Fedora

After installation of MariaDB 10.4 on Fedora, 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 2022-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
...

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.

Also check related DB guides for Fedora.

Install PostgreSQL 12 on Fedora

Install MySQL 8 on Fedora

Install MongoDB on Fedora

RELATED ARTICLES

Most Popular

Recent Comments