Introduction

MariaDB is a widely-used open-source relational database management system. This tutorial will guide you through the process of installing the latest version of MariaDB on Ubuntu 22.04.

Prerequisites

Before you begin, ensure you have:

  1. An Ubuntu 22.04 server or desktop system
  2. SSH access to the server or administrative access to the desktop system
  3. Root or sudo privileges

Step 1: Update System

Before installing any new software, it's always a good idea to update the package repository and installed packages:

sudo apt update
sudo apt upgrade -y

Step 2: Install MariaDB Server

Install the MariaDB server package using the following command:

sudo apt install -y mariadb-server

Step 3: Secure MariaDB Installation

Run the following command to secure the MariaDB installation:

sudo mysql_secure_installation

Follow the on-screen prompts to set the root password, remove anonymous users, disallow root login remotely, and remove the test database and access to it.

Step 4: Start and Enable MariaDB Service

Start the MariaDB service and enable it to start on system boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Step 5: Verify MariaDB Installation

Verify that MariaDB is running:

sudo systemctl status mariadb

If MariaDB is running, you should see an active status.

Step 6: Access MariaDB

Access the MariaDB command-line interface by running:

sudo mysql -u root -p

You will be prompted to enter the root password you set during the installation process.

Conclusion

You have successfully installed the latest MariaDB database on Ubuntu 22.04. You can now use MariaDB to create and manage databases for your applications.

Was this answer helpful? 0 Users Found This Useful (0 Votes)