How to Install MariaDB 10.6 on Fedora 39/38/37 Linux

MariaDB 10.6 is the latest Long-Term Support (LTS) open-source relational database management system release. It was released on June 15, 2021, and is based on the latest stable version of MySQL, with added features and performance improvements.

Here are some key differences between MariaDB 10.6 and its predecessor, MariaDB 10.5:

  • MariaDB 10.6 introduces a new column compression format that can reduce storage requirements by up to 70% for some workloads.
  • It also includes improvements to the query optimizer and better support for window functions in SQL queries.
  • The new release also includes enhancements to the Galera Cluster, such as improved performance and reliability and better handling of network partitions.
  • MariaDB 10.6 also supports the PostgreSQL-compatible PL/Python language, allowing developers to write database functions in Python.
  • Another significant improvement is supporting more storage engines, including RocksDB and MyRocks.

MariaDB 10.6 has gained popularity among Fedora users who utilize Fedora Server, as it is included in the default repository of Fedora 34 and newer versions. The LTS release provides stability and support for longer, making it an attractive choice for enterprise environments.

In addition to the Fedora default repository, MariaDB 10.6 can be installed from the latest version of RPM from MariaDB.org. This allows users to access the latest features and improvements not yet available in the Fedora repository.

The guide will demonstrate how to install MariaDB 10.6 on Fedora Linux using the Fedora default repository or the latest version of RPM from MariaDB.org.

Method 1: Install MariaDB 10.6 with Fedora

To install MariaDB 10.6 on Fedora Linux using the default repository, you can follow these steps:

  1. First, check whether the MariaDB module is enabled in your system by running the following command:
dnf module list mariadb

This command will display the available versions of MariaDB and their respective statuses (enabled or disabled). If MariaDB 10.6 is not enabled, you can enable it by running the following command:

sudo dnf module enable mariadb:10.6
  1. Next, install MariaDB 10.6 by running the following command:
sudo dnf install mariadb mariadb-server

This command will install the MariaDB client and server packages and their dependencies.

  1. Confirm the installation of MariaDB by checking the version and build:
mariadb --version

This command will display the version and build information of MariaDB installed on your system.

Method 2: Install MariaDB 10.6 with MariaDB.org

To install the latest MariaDB 10.6 on Fedora Linux using the official MariaDB.org repository, you can follow these steps:

  1. First, import the repository and GPG key by running the following command:
sudo tee /etc/yum.repos.d/mariadb.repo<<EOF
# MariaDB 10.6 Fedora repository list - created 2023-03-14 00:40 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.6/fedora/$releasever/$basearch
gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

This command uses the tee command to write the repository information to a file named mariadb.repo in the /etc/yum.repos.d/ directory. The <<EOF command indicates that we will input a multiline text block, which includes the repository information.

  1. Once the repository is created, install MariaDB 10.6 by running the following command:
sudo dnf install MariaDB-server MariaDB-client

Ensure that you use this exact command, including capitalization.

Following these steps, you can install MariaDB 10.6 on Fedora Linux using the official MariaDB.org repository. One potential drawback of this method is that the MariaDB.org repository may not release a new branch until it’s out of beta, so it may not always be the most up-to-date version.

Check MariaDB 10.6 Service Status

When installing MariaDB on Fedora, you must enable it afterward, as it is not enabled by default like some other Linux distributions. To do this, use the following command:

sudo systemctl enable mariadb --now

With enabling MariaDB, check the status to ensure no errors have occurred using the following command:

systemctl status mariadb

Example:

By default, you will find MariaDB status to be activated. If not, start MariaDB, and use the following command:

sudo systemctl start mariadb

To stop MariaDB:

sudo systemctl stop mariadb

To enable MariaDB on system startup:

sudo systemctl enable mariadb

To disable MariaDB on system startup:

sudo systemctl disable mariadb

To restart the MariaDB service:

sudo systemctl restart mariadb

Secure MariaDB 10.6 with Security Script

When installing a fresh copy of MariaDB 10.6, many security standards may consider the default security settings weak. It is recommended to secure the installation by running the installation security script.

To run the security script, use the following command:

sudo mariadb-secure-installation

Once the script is launched, you will be prompted to take the following steps to secure your installation:

  1. Set the password for the root account.
  2. Remove any root accounts that are accessible from outside the local host.
  3. Remove anonymous user accounts.
  4. Remove the test database, which anonymous users can access by default.

You can choose to remove everything by typing “Y” when prompted.

For example, the script will prompt you with various questions like:

Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y

To secure your installation, answer “Y” to all the above questions.

Once you’ve completed all the steps, your MariaDB 10.6 installation will be more secure. You can now use the database with more confidence that it is better protected against potential intrusion or hacking attempts.

Additional Tips

How to Upgrade Databases

Upgrading existing databases is an important step when upgrading to a newer version of MariaDB. Suppose you use a Fedora server to serve existing databases like CMS systems like WordPress. In that case, it is recommended that you upgrade your databases to ensure compatibility with the newer version of MariaDB.

To upgrade an existing database from MariaDB 10.5 to 10.6 on Fedora Linux, you can use the following command:

sudo mysql_upgrade -u [username] -p

Alternatively, you can use the following command without the username option:

sudo mysql_upgrade

Be sure to replace [username] with the database username, if applicable. This command will upgrade the existing MariaDB database to the latest version and ensure that it is compatible with the newer version of MariaDB.

How to Remove (Uninstall) MariaDB 10.6

If you wish to remove MariaDB 10.6 from your Fedora Linux system, you can use the following commands:

  1. To remove the MariaDB software completely, run the following command:
sudo dnf remove mariadb mariadb-server

Note that this command will remove most unused dependencies in the MariaDB installation to help clean up your system.

  1. If you want to roll back to the default selection of MariaDB on Fedora, use the following command:
sudo dnf module reset mariadb 

This command will reset to the default selection of MariaDB on your system. You can then install this version or choose another using the method you used to install MariaDB 10.7 but with a different version option.

For example, to install MariaDB 10.5, use the following command:

sudo dnf module enable mariadb:10.5
  1. If you installed the MariaDB version from the official repository, you might want to remove the repository file using the following command if you don’t plan to use it again:
sudo rm /etc/yum.repos.d/mariadb.repo

By using these commands, you can successfully remove MariaDB 10.6 from your Fedora Linux system, roll back to the default selection of MariaDB, or remove the repository file.

Conclusion

In conclusion, installing MariaDB 10.6 on Fedora Linux is a straightforward process that can be done using the default Fedora repository or the official MariaDB.org version. Following the steps outlined in this guide, users can easily install, secure, and remove MariaDB 10.6 from their system. With its long-term support (LTS) status, improved performance, and added features, MariaDB 10.6 has become a popular choice for Fedora Linux users who utilize Fedora Server.

Further Learning

Here are some helpful resources for learning more about MariaDB 10.6 and using it on Fedora:

  1. Official MariaDB documentation: https://mariadb.com/docs/
  2. MariaDB community forum: https://mariadb.com/kb/en/community/
  3. Fedora documentation: https://docs.fedoraproject.org/en-US/docs/
  4. Fedora community forum: https://discussion.fedoraproject.org/
  5. MariaDB YouTube channel: https://www.youtube.com/@mariadb
  6. The MariaDB tag on Stack Overflow: https://stackoverflow.com/questions/tagged/mariadb
  7. The Fedora subreddit: https://www.reddit.com/r/Fedora/
  8. The MariaDB subreddit: https://www.reddit.com/r/MariaDB/

Share to...