Home  »  ArticlesGuidesHow ToSoftwareTechnologyTools   »   How To Install MariaDB Community 11.3 on Ubuntu 24.04 LTS

How To Install MariaDB Community 11.3 on Ubuntu 24.04 LTS

MariaDB is a popular, open-source relational database management system that is a fork of MySQL. With MariaDB Community 11.3, you get enhanced performance, reliability, and security features. This guide will walk you through the steps to install MariaDB Community 11.3 on your Ubuntu 24.04 LTS system.

Prerequisites

Before starting the installation process, ensure you have:

  1. A system running Ubuntu 24.04 LTS.
  2. Sudo privileges to install and configure software.

Step 1: Update Your System

First, update your package index to ensure you have the latest information on available packages:

$ sudo apt update
$ sudo apt upgrade -y

Step 2: Add the MariaDB APT Repository

To install MariaDB Community 11.3, you need to add the official MariaDB APT repository to your system.

  1. Import the MariaDB signing key:
$ sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
  1. Add the MariaDB repository:
$ sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el,s390x] http://mariadb.mirror.serverion.com/repo/11.3/ubuntu focal main'

Step 3: Install MariaDB

After adding the repository, install MariaDB with the following command:

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

Step 4: Secure the MariaDB Installation

MariaDB comes with a security script that helps you secure your installation by removing insecure default settings and access:

$ sudo mysql_secure_installation

Follow the prompts to configure the security options. You will be asked to set a root password, remove anonymous users, disallow root login remotely, and remove the test database.

Step 5: Verify the Installation

To ensure that MariaDB is installed and running correctly, check the status of the MariaDB service:

$ sudo systemctl status mariadb

You should see output indicating that MariaDB is active and running.

Step 6: Log In to MariaDB

Log in to the MariaDB shell using the root account:

$ sudo mariadb -u root -p

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

Step 7: Basic MariaDB Commands

Here are some basic MariaDB commands to get you started:

  • Create a database:
MariaDB [(none)]> CREATE DATABASE mydatabase;
  • Create a user:
MariaDB [(none)]> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
  • Grant privileges to the user:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
  • Show databases:
MariaDB [(none)]> SHOW DATABASES;
  • Exit MariaDB:
MariaDB [(none)]> EXIT;

Conclusion

Congratulations! You have successfully installed MariaDB Community 11.3 on your Ubuntu 24.04 LTS system. MariaDB is now ready to use for your database management needs. Whether you are developing applications or managing data, MariaDB offers a robust and scalable solution. For more information and advanced configurations, check out the official MariaDB documentation.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.