How to Install MariaDB on Ubuntu?

18-Jul-2023

.

Admin

How to Install MariaDB on Ubuntu?

Hello Friends,

In this tutorial, I will show you how to install MariaDB on Ubuntu. you will learn how to install and start using MariaDB on Ubuntu. In this article, we will implement an installing MariaDB on Ubuntu. This article will give you a simple example of how to install MariaDB from the command line. follow the bellow steps for building MariaDB on Ubuntu.

In this tutorial, we will learn how to install and configure MariaDB on Ubuntu 22.04. MariaDB is an open-source relational database management system compatible with MySQL, created by some of MySQL’s originators as an alternative platform.

Step 1: Update System Dependencies


First of all, open the terminal and execute the following command on the command line to update system dependencies:

sudo apt update

sudo apt upgrade

Step 2: Install MariaDB

Then execute the following command on the command line to install MariaDB on the linux ubuntu system:

sudo apt install mariadb-server mariadb-client

Once the installation is completed, the MariaDB service will start automatically. To verify that the MariaDB server is running, type:

sudo service mariadb status

Step 3: Configure MariaDB

Use the following command to configure mariaDB:

sudo mysql_secure_installation

Then prompt will be open; is as follow:

Setting the root password or using the unix_socket ensures that nobody

can log into the MariaDB root user without the proper authorization.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n]

On the next prompt, you will be asked to set a password for the MariaDB root user.

If you set up the validate password plugin, the script will show you the strength of your new password. Type y to confirm the password.

Next, you’ll be asked to remove the anonymous user, restrict root user access to the local machine, remove the test database, and reload privilege tables. You should answer y all your questions.

Step 4: Test Installation Of MariaDB

Then execute the following command on the command line to check the status of MariaDB:

sudo mysqladmin version

I hope it can help you...

#Ubuntu