𝗠𝗮𝗿𝗶𝗮𝗗𝗕 is an open-source software that is widely known as an alternative to MySQL. It has many features, including ACID compliance, high performance, and scalability. Users can create and manage databases, along with running SQL queries with ease after installing MariaDB. The g...
𝗠𝗮𝗿𝗶𝗮𝗗𝗕 is an open-source software that is widely known as an alternative to MySQL. It has many features, including ACID compliance, high performance, and scalability. Users can create and manage databases, along with running SQL queries with ease after installing MariaDB. The goal of installing MariaDB on Ubuntu 24.04 is to provide the system with a powerful and trustworthy relational database management system (RDBMS) for the storage, retrieval, and management of data for several applications.
This article will guide you through the steps of installing or uninstalling MariaDB.
https://greenwebpage.com/community/how-to-install-mariadb-on-ubuntu-24-04/
1/10
April 4, 2025
How to Install MariaDB on Ubuntu 24.04
greenwebpage.com/community/how-to-install-mariadb-on-ubuntu-24-04/
Tutorials
by Karim Buzdar
April 4, 2025
MariaDB is an open-source software that is widely known as an alternative to MySQL. It
has many features, including ACID compliance, high performance, and scalability. Users
can create and manage databases, along with running SQL queries with ease after
installing MariaDB. The goal of installing MariaDB on Ubuntu 24.04 is to provide the
system with a powerful and trustworthy relational database management system
(RDBMS) for the storage, retrieval, and management of data for several applications.
This article will guide you through the steps of installing or uninstalling MariaDB.
How to Install MariaDB on Ubuntu 24.04?
How to Uninstall MariaDB on Ubuntu 24.04?
How to Install MariaDB on Ubuntu 24.04?
No matter what web applications you’re building, whether you require a content
management system or any other software that supports a database, MariaDB can
support all of your needs.
Method 1: Using the Ubuntu Default Repository
2/10
Method 2: Using the MariaDB Repository
Let’s start with the simpler method first.
Method 1: Using the Ubuntu Default Repository
Here are the steps to install MariaDB on Ubuntu 24.04 by utilizing the Ubuntu repository:
Step 1: Updating the Package Index
To use the Ubuntu default repository, users first need to update the system repository to
update the package index by utilizing the apt command.
sudo apt update
Step 2: Install the mariadb-server Package
Now, use the apt command to install the mariadb-server package as a sudo user.
sudo apt install mariadb-server
Step 3: Securing MariaDB Installation
3/10
Execute the mysql_secure_installation script to limit access permissions to the server,
and improve security after installation. This script walks users through a few prompts that
help dictate how secure the MariaDB Installation would be:
sudo mysql_secure_installation
While executing the script, a prompt will come up that will require you to set a current
database password that needs to be assigned to the root user. If users haven’t set one
yet, users can just hit ENTER to mean none. Other security options will also be made
available for you as the script guides you.
4/10
Step 4: Verification of the MariaDB Installation
To confirm, log in to the MariaDB shell under the root user and provide the password.
sudo mysql -u root -p
Optional: Updating MariaDB on Ubuntu 24.04
In order to install or upgrade to the latest version of MariaDB on Ubuntu, the system
packages should be updated, the MariaDB APT repository should be added, followed by
installing the MariaDB11.0 server/ client. After that, a secure installation of the MariaDB,
followed by a test for the installation.
sudo mariadb-upgrade
Users can also upgrade by employing the “mariadb-upgrade” command. This is taken
from method 1.
Method 2: Using the MariaDB Repository
In order to upgrade to the newest MariaDB version for Ubuntu 24.04, the official fare is
recommended. This is how you install MariaDB on Ubuntu 24.04 using the MariaDB
repository:
Step 1: Update Package list
In this case, make sure your system packages list is up-to-date so you are using the most
recent version.
sudo apt update
5/10
Step 2: Install Software Properties
Users are now prompted to install the sister package which is crucial for adding the new
repositories.
sudo apt install software-properties-common
Step 3: Import the MariaDB GPG Key
Use the “apt-key” command to import the MariaDB GPG Key to check the repository’s
authenticity.
sudo apt-key adv --fetch-keys
'https://mariadb.org/mariadb_release_signing_key.asc'
6/10
Step 4: Add the MariaDB Repository
Now, append the MariaDB repository to the system. For this purpose, you must substitute
“11.2.3” with the version you like to install:
sudo add-apt-repository 'deb [arch=amd64]
http://mariadb.mirror.globo.tech/repo/11.2.3/ubuntu jammy main'
Note: Should the Ubuntu version have a different codename, the “jammy” could be
substituted in the repository line. If the codename is not recognized automatically,
substitute $(lsb_release -cs) with the codename of the Ubuntu version.
Step 5: Update Packages List
To enable installation of the MariaDB from the included repository, update the package’s
indexing:
sudo apt update
7/10
Step 6: Install MariaDB Server
Now, users can download the MariaDB server and client packages from the official
repository for MariaDB:
sudo apt install mariadb-server mariadb-client
Step 7: Secure MariaDB Installation (optional but recommended)
In this step, run the script to assign a root password. The following script will prompt
users for additional security measures that may be taken as well:
sudo mysql_secure_installation
8/10
Step 8: Verify Installation
Now, confirm that the installed MariaDB is operational. To do so, review the status of the
MariaDB service:
sudo systemctl status mariadb
Alternatively, the users may use the mysql command to connect to the MariaDB as
follows:
sudo mysql -u root -p
9/10
That would be all for this procedure for the most recent version of MariaDB.
How to Uninstall MariaDB on Ubuntu 24.04?
In order to delete MariaDB from Ubuntu 24.04, users may run the command ‘auto-
remove’ like so:
sudo apt autoremove mariadb-server mariadb-client --purge -y # For Removing
Packages
'
sudo add-apt-repository --r 'deb [arch=amd64]
http://mariadb.mirror.globo.tech/repo/11.2.3/ubuntu jammy main' # For Removing
Repository
This will delete the server components alongside the client components for MariaDB.
Conclusion
To download and set up MariaDB on Ubuntu 24.04, one needs to first update the package
index and then install the MariaDB server package by executing “sudo apt install
mariadb-server”. To make the system secure then one must run the
“mysql_secure_installation” script after the installation is done alongside configuring
MariaDB.
10/10
In order to get the latest version of MariaDB on Ubuntu 24.04, the MariaDB repository
needs to be added then the mariadb-server and mariadb-client packages need to be
installed for them to be used. To access/start MariaDB as a newly added user, run the
command “mysql -u myuser -p”. Thereafter, enter the password of the user. This is how
users are able to create tables, add some data, and execute SQL statements in the
database.