How To Install MariaDB 10.9 on Ubuntu 20.04

[rank_math_breadcrumb]

Share your love

In this guide from the Orcacore website, we want to teach you How To Install MariaDB 10.9 on Ubuntu 20.04. MariaDB is an open-source relational database management system. As with other relational databases, MariaDB stores data in tables made up of rows and columns. Users can define, manipulate, control, and query data using Structured Query Language, more commonly known as SQL.

Steps To Install MariaDB 10.9 on Ubuntu 20.04

To install MariaDB 10.9, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on the Initial Server Setup with Ubuntu 20.04.

Now follow the steps below to complete this guide.

1. Install Required Packages for MariaDB 10.9

First, you need to install the required packages and dependencies on your server with the following command:

sudo apt install curl software-properties-common dirmngr ca-certificates apt-transport-https -y

2. Import MariaDB 10.9 GPG Key and Repository

At this point, you need to import the MariaDB 10.9 GPG key and Repository by using the following command:

curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.9

In your output, you will see:

Import MariaDB 10.9 GPG Key & Repository

Then, update your local package index with the following command:

sudo apt update

3. Installing MariaDB 10.9 on Ubuntu 20.04

To install MariaDB, you must install the client and the server packages. To do this, run the command below:

sudo apt install mariadb-server mariadb-client -y

Verify your MariaDB installation by checking its version:

mariadb --version
Output
mariadb Ver 15.1 Distrib 10.9.2-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

MariaDB will start automatically on your server. To check that it is active and running on your server, run the following command:

sudo systemctl status mariadb
Installing MariaDB 10.9 on Ubuntu 20.04

Also, you can enable your MariaDB service to start on boot:

sudo systemctl enable mariadb

4. Run MariaDB Secure Installation Script

At this point, you can secure your MariaDB 10.9 installation on Ubuntu 20.04 by running a security script.

To do this, use the following command:

sudo mysql_secure_installation

You will be asked to set a root password for your MariaDB, and from there, enter yes to answer other questions.

Now you can access your MariaDB shell with the command below:

sudo mysql -u root -p

Enter your root password and press Enter:

Access MariaDB shell

5. Remove MariaDB 10.9 from Ubuntu

If you no longer wish to use MariaDB and want to remove it in full, execute the following command:

sudo apt autoremove mariadb-server mariadb-client --purge -y

Note: This will remove MariaDB completely, including all database data. To remove the bash script repository, use the following command.

# sudo rm /etc/apt/sources.list.d/mariadb.list
# sudo apt update

For more information, you can visit the MariaDB Documentation Page.

Conclusion

In conclusion, installing MariaDB 10.9 on Ubuntu 20.04 is a simple process. By adding the official MariaDB repository, updating the system, and installing the server, you get a powerful and reliable database ready to use. It’s a great choice for managing data in web applications and other projects.

Hope you enjoy it. You may be interested in these articles:

Install Varnish Cache with Apache on Ubuntu 20.04

How To Set up XWiki on Ubuntu 20.04

Install and Configure Memcached on Ubuntu 20.04

Share your love

Stay informed and not overwhelmed, subscribe now!