How to Install MariaDB 11.04 on Ubuntu 24.04

How to Install MariaDB 11.04 on Ubuntu 24.04

Bitnesia Database Mar 24, 2026 203 ID

MariaDB is an open-source relational database management system (RDBMS) developed as a fork of MySQL. The main goal of the project is to maintain full compatibility with MySQL while offering improved performance, scalability, and stronger security features. MariaDB is widely used across various sectors, from small websites to large-scale business systems, thanks to its stability and community-friendly open-source license.

On May 24, 2024, the development team released MariaDB 11.4, the latest Long Term Support (LTS) version designed for long-term use in production environments. According to endoflife.date, this version will receive Community Support until May 29, 2029, and Enterprise Support until January 16, 2033. With its extended support period, MariaDB 11.4 is an excellent choice for system administrators and developers seeking long-term stability and security.

This tutorial will guide you step-by-step through installing MariaDB 11.4 on Ubuntu 24.04, covering installation, security configuration, database and user creation, and solutions to common issues.

System Update

Before starting the installation, make sure your system is up to date:

sudo apt update && sudo apt upgrade -y

Add the MariaDB Repository

MariaDB 11.4 is not available in Ubuntu 24.04’s default repositories, so we’ll add the official MariaDB repository.

Download the MariaDB repository key:

sudo apt install apt-transport-https curl -y
sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'

Create the repository file:

sudo nano /etc/apt/sources.list.d/mariadb.sources

Add the following configuration:

# MariaDB 11.4 repository list
# https://mariadb.org/download/
X-Repolib-Name: MariaDB
Types: deb
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
URIs: https://deb.mariadb.org/11.4/ubuntu
Suites: noble
Components: main main/debug
Signed-By: /etc/apt/keyrings/mariadb-keyring.pgp

Install MariaDB Server

Once the repository has been added, install MariaDB 11.4 with the following commands:

sudo apt update
sudo apt install mariadb-server -y

After installation, check the MariaDB service status:

sudo systemctl status mariadb

Make sure the status shows active (running).

Secure the MariaDB Installation

MariaDB provides a built-in security script to remove unsafe default configurations and set the root password.

Run the following command:

sudo mariadb-secure-installation

You will be prompted to answer several questions:

  1. Set the root password
  2. Remove anonymous users
  3. Disallow root login remotely
  4. Remove the test database
  5. Reload privilege tables
  6. It is recommended to answer Y (Yes) to all security-related prompts.

Access MariaDB

After completing the configuration, log in to the MariaDB shell:

sudo mariadb -u root -p

Enter the root password you set earlier.

Create a New Database and User

Once logged into the MariaDB shell, create a new database:

CREATE DATABASE project_db;

Then, create a new user and grant privileges:

CREATE USER 'bitnesia'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON project_db.* TO 'bitnesia'@'localhost';
FLUSH PRIVILEGES;
exit

Common Troubleshooting

Below are some common issues you might encounter during installation or configuration:

MariaDB Fails to Start

Check the service status:

sudo systemctl status mariadb

If there’s an error, try restarting the service:

sudo systemctl restart mariadb

Or inspect the logs for details:

sudo journalctl -xeu mariadb

Failed to Log In as Root

If logging in with sudo mariadb -u root -p fails, try accessing directly without a password:

sudo mariadb

Then reset the root password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewStrongPassword123!';
FLUSH PRIVILEGES;

MariaDB Port Not Open for Remote Access

Edit the configuration file:

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

Find the line:

bind-address = 127.0.0.1

Change it to:

bind-address = 0.0.0.0

Restart the service:

sudo systemctl restart mariadb

If your system uses UFW (Uncomplicated Firewall), ensure that port 3306 is open for connections from trusted IPs or networks.

To allow connections from a specific IP:

sudo ufw allow from 192.168.1.10 to any port 3306

To allow connections from the entire local network:

sudo ufw allow from 192.168.1.0/24 to any port 3306

To allow connections from anywhere (not recommended for public servers):

sudo ufw allow 3306/tcp

Check the firewall rules:

sudo ufw status

Conclusion

By following the steps above, you have successfully installed MariaDB 11.4 LTS on Ubuntu 24.04. This version offers long-term stability and high performance, making it suitable for both production database servers and development environments. Remember to maintain security by applying regular updates and performing scheduled data backups.

Did this solve your problem? Consider leaving a tip to show your appreciation!

Say Thanks with a Tip

Related Posts