✨ Install MariaDB 11 on Ubuntu 22.04 ✨

1️⃣ Update System Packages

Open your terminal and run the following commands to update your system:

sudo apt update
sudo apt upgrade -y

2️⃣ Add the MariaDB APT Repository

Import the GPG key and add the MariaDB repository:

sudo apt install -y software-properties-common dirmngr apt-transport-https ca-certificates
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://mariadb.org/mariadb_release_signing_key.asc | sudo tee /etc/apt/keyrings/mariadb.gpg > /dev/null

Add the repository to your system:

echo "deb [signed-by=/etc/apt/keyrings/mariadb.gpg] https://mirrors.xtom.com/mariadb/repo/11.0/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/mariadb.list

3️⃣ Install MariaDB 11

Update your package list and install MariaDB:

sudo apt update
sudo apt install mariadb-server mariadb-client -y

4️⃣ Verify Installation

Check if MariaDB is running:

sudo systemctl status mariadb

If needed, start and enable MariaDB:

sudo systemctl start mariadb
sudo systemctl enable mariadb

5️⃣ Secure MariaDB Installation

Run the security script to configure MariaDB:

sudo mysql_secure_installation

Follow the prompts to set a root password and secure the installation.

6️⃣ Test MariaDB

Log in and verify the installation:

sudo mariadb -u root -p
SELECT VERSION();
EXIT;

7️⃣ Optional: Enable Remote Access

To allow remote connections, edit the configuration file:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Change bind-address to:

bind-address = 0.0.0.0

Restart MariaDB:

sudo systemctl restart mariadb

8️⃣ Backup and Restore MariaDB

Backup Process

To back up a MariaDB database, use the mysqldump command:

mysqldump -u [username] -p [database_name] > [backup_file.sql]

Example:

mysqldump -u root -p my_database > my_database_backup.sql

This will create a backup file named my_database_backup.sql in the current directory.

Restore Process

To restore a database from a backup, use the following command:

mysql -u [username] -p [database_name] < [backup_file.sql]

Example:

mysql -u root -p my_database < my_database_backup.sql

Ensure the database my_database exists before restoring, or create it with:

mysql -u root -p -e "CREATE DATABASE my_database;"
⚠️ Note: Be cautious when enabling remote access. Ensure you secure your server with proper firewall rules.

 

 

Related articles

Create a Project in Azure DevOps-Agile Process

Create a Project in Azure DevOps-Agile Process Introduction The Agile Process in Azure DevOps is designed for teams that follow...

Setup Storage Account for Data Archive

Setup Storage Account for Data Archive 🌟 Introduction Azure Storage provides a cost-effective and secure solution for storing infrequently accessed...

The Basics of Continuous Integration & Delivery With 10 Most Popular Tools to Use

The Basics of Continuous Integration & Delivery With 10 Most Popular Tools to Use Continuous Integration (CI) and Continuous...

What is a Branching Strategy in Git

What is a Branching Strategy in Git Branches in Git provide an independent line of work derived from the...