How to Install MariaDB on Ubuntu 22.04: Step-by-Step Guide

Introduction:

MariaDB is a popular open-source relational database management system and a drop-in replacement for MySQL. If you’re using Ubuntu 22.04 and want to install MariaDB, this step-by-step guide will walk you through the installation process.

Step 1: Update System Packages

  1. Open a terminal on your Ubuntu 22.04 system.
  2. Update the system packages to their latest versions by running the following command:
sudo apt update

Step 2: Install MariaDB

  1. Install the MariaDB server package by executing the following command:
sudo apt install mariadb-server

2. Enter ‘Y’ when prompted to confirm the installation.

3. Wait for the installation to complete.

Step 3: Start and Enable MariaDB

  1. Start the MariaDB service by running the following command:
sudo systemctl start mariadb

2. Enable the MariaDB service to start automatically on system boot:

sudo systemctl enable mariadb

Step 4: Secure MariaDB Installation

  1. Secure your MariaDB installation by running the following command:
sudo mysql_secure_installation

2. You will be prompted to set a password for the MariaDB root user. Choose a strong password and remember it for future use.

3. Follow the prompts to answer a series of security-related questions. It is recommended to answer ‘Y’ to all questions for improved security.

Step 5: Verify MariaDB Installation

  1. Check the status of the MariaDB service by executing the following command:
sudo systemctl status mariadb

If the service is active and running, it means MariaDB has been successfully installed.

2. You can also verify the installation by logging into the MariaDB shell:

sudo mysql -u root -p

Enter the root password you set during the secure installation step. If you can access the MariaDB shell without any errors, it confirms a successful installation.

Conclusion:

By following the steps outlined in this article, you can easily install MariaDB on your Ubuntu 22.04 system. MariaDB is a powerful and feature-rich database management system that can handle your data storage needs effectively. Leverage its compatibility with MySQL and take advantage of its performance and scalability features. Install MariaDB on your Ubuntu 22.04 system and enjoy the benefits of this open-source database solution.


Leave a Reply

Your email address will not be published. Required fields are marked *