How to Install MariaDB 10.6 on Fedora 39, 38 Linux

This guide will demonstrate how to install MariaDB 10.6 on Fedora Linux using the command-line terminal and utilizing the MariaDB.org RPM for the latest version and future updates.

MariaDB 10.6, a Long-Term Support (LTS) release, continues to be a cornerstone for database administrators and developers despite newer versions being available. Its enduring relevance is underpinned by a suite of robust features and optimizations that ensure stability, performance, and compatibility. As a historical marker in the MariaDB lineage, version 10.6 offers an intriguing mix of enhanced SQL capabilities, security improvements, and performance tweaks, making it a reliable choice for varied database needs.

Key Highlights of MariaDB 10.6:

  • Atomic DDL Operations: Ensures structural changes are either fully completed or not done at all, enhancing database integrity.
  • JSON Table Functions: Allows seamless interactions with JSON data, enabling efficient data interchange and storage.
  • InnoDB Performance Improvements: Optimizes response times and resource utilization, particularly for high-load environments.
  • Column Compression: Reduces storage costs and improves I/O efficiency for large datasets.
  • Replication Enhancements: Offers more robust and flexible replication options, improving data consistency and disaster recovery capabilities.
  • Galera Cluster 4 Integration: Facilitates synchronous multi-master replication, enhancing high availability and scaling.
  • OAuth 2.0 Authentication: Enhances security with modern authentication protocols, ensuring secure database access.
  • SQL Compatibility: Broadens support for SQL standards, ensuring compatibility with a wide range of applications and tools.

As we delve into the technical intricacies of installing MariaDB 10.6, these features underscore the version’s relevance and utility in today’s database landscape.

Now, let’s transition to the practical steps to install MariaDB 10.6 on your Fedora system.

Install MariaDB 10.6 on Fedora via MariaDB.org

Update Fedora Before Installing MariaDB 10.6

Before starting the MariaDB installation, it’s essential to update your Fedora system. This ensures that all packages are up to date, minimizing potential conflicts and security vulnerabilities. Run the following command to update your system:

sudo dnf upgrade --refresh

This command upgrades all your system’s packages, with the --refresh option ensuring that you have the latest information from all configured repositories.

Import the MariaDB 10.6 RPM Repository

To install MariaDB 10.6, you must first import the repository that contains the MariaDB packages. This involves adding the MariaDB repository to your system’s repository list and importing the GPG key for verifying package integrity. Execute the following commands to import the MariaDB 10.6 repository:

sudo tee /etc/yum.repos.d/mariadb.repo <<EOF
# MariaDB 10.6 Fedora repository list
# 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 step ensures that your system recognizes the official MariaDB repository and verifies the packages’ authenticity using the provided GPG key.

Install MariaDB 10.6 Using the DNF Command

After configuring the repository, you’re ready to install MariaDB 10.6. The installation is straightforward with the DNF package manager. Use the following command to install MariaDB server and client components:

sudo dnf install MariaDB-server MariaDB-client

It’s important to maintain the case sensitivity in the package names (MariaDB-server and MariaDB-client) to ensure the correct packages are installed. This step will install the MariaDB 10.6 server and client on your Fedora system, setting the stage for its configuration and use.

Check MariaDB 10.6 Service Status on Fedora

Enabling and Checking MariaDB Service

After installing MariaDB on Fedora, it’s crucial to enable the service, as it does not automatically start like on some Linux distributions. Activate the MariaDB service and ensure it starts with the system using this command:

sudo systemctl enable mariadb --now

This command not only enables the MariaDB service but also starts it immediately with the --now flag.

Verifying Service Status

To confirm that MariaDB is running correctly without any issues, check its status:

systemctl status mariadb

Typically, the service status should show as active.

Secure MariaDB 10.6 with Security Script on Fedora

Enhancing Security Post-Installation

After installing MariaDB 10.6 on Fedora, it’s crucial to strengthen the default security settings, which may be considered inadequate by many security benchmarks. To fortify your MariaDB installation, execute the provided security script:

sudo mariadb-secure-installation

This command initiates a security script that guides you through a series of recommendations to secure your MariaDB server.

Step-by-Step Security Enhancements

During the script execution, you’ll encounter prompts to implement security measures:

  • Root Password Configuration: Set a strong password for the root account to prevent unauthorized access.
  • Remote Root Access: Remove the ability for the root account to log in from remote locations, enhancing security against external threats.
  • Anonymous User Accounts: Eliminate anonymous user accounts, which can be a potential security loophole.
  • Test Database Removal: Remove the test database, which is accessible by default to anonymous users and can pose a security risk.

Respond with “Y” to these prompts to apply the recommended security settings:

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

Finalizing Security Enhancements

By affirming these prompts with “Y,” you ensure that your MariaDB installation is safeguarded against common vulnerabilities, setting a solid foundation for a secure database environment. After completing these steps, your MariaDB 10.6 server on Fedora is significantly more secure, providing a robust platform for your data management needs.

Additional Tips for MariaDB 10.6 on Fedora

Upgrading Your Database

When transitioning to MariaDB 10.6, it’s crucial to upgrade your existing databases to maintain compatibility and performance. If your Fedora server hosts databases for applications like WordPress, execute the following command to upgrade from MariaDB 10.5 to 10.6:

sudo mysql_upgrade -u [username] -p

Replace [username] with your database username. If the username is not required, simply use:

sudo mysql_upgrade

This command ensures that your databases align with the new features and improvements in MariaDB 10.6.

Removing MariaDB 10.6

Uninstalling MariaDB

To uninstall MariaDB 10.6 from your Fedora system, execute the following command:

sudo dnf remove MariaDB-server MariaDB-client

Removing the MariaDB Repository

If you no longer need the MariaDB repository, especially if it was added for a specific version, remove it with:

sudo rm /etc/yum.repos.d/mariadb.repo

This deletion prevents your system from using this repository for future installations or updates.

Conclusion

We’ve walked through the steps to install, secure, and manage MariaDB 10.6 on Fedora, ensuring your database is up-to-date and fortified against common security threats. Whether you’re upgrading an existing setup or starting fresh, these guidelines are designed to help you get the most out of MariaDB on your Fedora system. Don’t forget to regularly check for updates and consider backing up your data to keep your databases reliable and secure. Thanks for following along, and here’s to your success with MariaDB on Fedora!

Leave a Comment