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

MariaDB 10.5 is a Long-Term Support (LTS) release designed to provide reliable and consistent database management for businesses and developers. As an LTS release, MariaDB 10.5 is maintained and supported by the MariaDB Foundation alongside the more recent MariaDB 10.6 LTS. This means that users of MariaDB 10.5 can expect regular security patches, bug fixes, and updates to ensure stability and optimal performance for their database deployments.

Major Changes in MariaDB 10.5

Compared to its predecessors, MariaDB 10.5 introduces several important enhancements and features, ensuring that it remains an excellent choice for those seeking a robust and feature-rich database solution. Some of the most notable changes include:

  • ColumnStore Storage Engine: MariaDB 10.5 has an integrated ColumnStore storage engine, a high-performance analytics engine that significantly improves query processing capabilities for large datasets.
  • InnoDB Improvements: MariaDB 10.5 features several improvements to the InnoDB storage engine, including instant DROP COLUMN support, atomic DDL statements, and enhanced data dictionary handling, providing better performance and manageability.
  • Galera Cluster 4: MariaDB 10.5 introduces Galera Cluster 4, a major update to the synchronous multi-master replication technology that provides improved performance, consistency, and ease of use for large-scale database deployments.
  • System Versioned Tables: MariaDB 10.5 supports system versioned tables, allowing users to maintain a history of changes to specific tables and enabling temporal queries for historical data analysis.
  • JSON Functions: MariaDB 10.5 enhances its support for JSON data types with a host of new JSON functions, providing increased flexibility and utility for developers working with JSON data.
  • Optimizer Enhancements: MariaDB 10.5 features a range of optimizer enhancements, including improved histogram-based statistics, better subquery optimization, and more efficient execution plans for complex queries.
  • Security Improvements: MariaDB 10.5 brings several security enhancements, such as using SSL/TLS for encrypted connections by default, improved password handling, and enhanced role management.

The following guide will demonstrate how to install MariaDB 10.5 on Fedora Linux using the official MariaDB.org repository for the latest version or Fedora’s own repositories.

Section 1: Install MariaDB 10.5 with Fedora Repository

Step 1: List Available MariaDB Modules

To install MariaDB 10.5 on Fedora Linux using the default repository, 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). It allows you to identify which version of MariaDB is currently active in your system’s repository.

Step 2: Enable MariaDB 10.5

If MariaDB 10.5 is not enabled, you can enable it by running the following command:

sudo dnf module enable mariadb:10.5

This command activates the MariaDB 10.5 module in your system’s repository, making it available for installation.

Step 3: Install MariaDB 10.5

Next, install MariaDB 10.5 by running the following command:

sudo dnf install mariadb mariadb-server

This command will install the MariaDB client and server packages along with their dependencies. The client package provides the necessary tools to interact with the MariaDB server, while the server package is responsible for managing the actual database system.

Step 4: Confirm MariaDB 10.5 Installation

Confirm the installation of MariaDB by checking the version and build with the following command:

mariadb --version

This command will display the version and build information of MariaDB installed on your system. It helps to ensure that you have successfully installed the desired version of MariaDB, in this case, MariaDB 10.5.

Section 2: Install MariaDB 10.5 with MariaDB.org Repository

Step 1: Import MariaDB.org Repository

To install the latest MariaDB 10.5 on Fedora Linux using the official MariaDB.org repository, first import the repository and GPG key by running the following command:

sudo tee /etc/yum.repos.d/mariadb.repo<<EOF
# MariaDB 10.5 Fedora repository list - created 2023-04-12 00:30 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.5/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. This sets up the MariaDB.org repository for MariaDB 10.5 and ensures that the packages are signed with the proper GPG key to maintain security.

Step 2: Install MariaDB 10.5

Once the repository is created, install MariaDB 10.5 by running the following command:

sudo dnf install MariaDB-server MariaDB-client

Ensure that you use this exact command, including capitalization. This command installs the MariaDB server and client packages from the MariaDB.org repository. The server package is responsible for managing the actual database system, while the client package provides the necessary tools to interact with the MariaDB server.

Step 3: Verify MariaDB 10.5 Installation

Once installed, confirm the installation with the following command:

mariadb --version

This command will display the version and build information of MariaDB installed on your system. It helps to ensure that you have successfully installed the desired version of MariaDB, in this case, MariaDB 10.5.

Section 3: Check MariaDB 10.5 Service Status

After installing MariaDB on Fedora, you need to enable the service, as it is not enabled by default like in some other Linux distributions.

Step 1: Enable MariaDB Service

To enable the MariaDB service, use the following command:

sudo systemctl enable mariadb --now

This command enables and starts the MariaDB service immediately.

Step 2: Check MariaDB Service Status

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

systemctl status mariadb

By default, you will find the MariaDB service status to be active. If not, you can start the MariaDB service manually.

Step 3: Start, Stop, and Manage MariaDB Service

To start MariaDB, 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

These commands allow you to manage the MariaDB service, ensuring it’s running when needed and stopped when not in use.

Section 4: Secure MariaDB 10.5 with Security Script

When installing a fresh copy of MariaDB 10.5, the default security settings may not be strong enough to meet common security standards. It is recommended to secure the installation by running the installation security script.

Step 1: Run the 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.

Step 2: Respond to Security Script Prompts

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.

Section 5: Additional Commands & Tips

Step 1: How to Upgrade Databases

Upgrading existing databases is an important step when upgrading to a newer version of MariaDB. If you use a Fedora server to serve existing databases like CMS systems such as WordPress, 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.3 to 10.5 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.

Step 2: How to Remove (Uninstall) MariaDB 10.5

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

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.

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 using the Fedora default repository installation method.

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

sudo dnf module enable mariadb:10.5

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.5 from your Fedora Linux system, roll back to the default selection of MariaDB, or remove the repository file.

Conclusion: Installing MariaDB 10.5 on Fedora Linux

Overall, installing MariaDB 10.5 on Fedora Linux is a straightforward process that can significantly improve the performance and security of your database system if you are using a far older version, as 10.5 has now been in LTS for quite a while and is considered very stable. Following the steps outlined in this guide, you can successfully set up, secure, and manage MariaDB 10.5 on your Ubuntu server. Always follow best practices and regularly update your software to maintain a secure and efficient environment.

Additional Resources and Links

To further enhance your understanding of MariaDB and its usage, here is a list of official resources and links that provide more information:

  • MariaDB Official Website: The official website of MariaDB, where you can find the latest news, updates, and releases.
  • MariaDB Documentation: Comprehensive documentation on all aspects of MariaDB, including installation, configuration, administration, and usage.
  • MariaDB Knowledge Base: An extensive collection of articles and guides covering various MariaDB-related topics.
  • MariaDB Blog: The official MariaDB blog contains insightful articles, tips, and best practices for using MariaDB.
  • MariaDB on GitHub: The official MariaDB GitHub repository, where you can access source code, report issues, and contribute to the project.

Share to...