How to Install MariaDB on Ubuntu 22.04

In this tutorial, i am going to show you how to install and configure MariaDB on Linux ubuntu 22.04.

How to Install MariaDB on Ubuntu 22.04

Follow the below given steps to install and configure MariaDB on Linux ubuntu 22.04:

  • Step 1 – Update System Dependencies
  • Step 2 – Install MariaDB
  • Step 3 – Configure MariaDB
  • Step 4 – Test Installation Of MariaDB

Step 1 – Update System Dependencies

Start terminal and run the following command on terminal to update system dependencies:

sudo apt update
sudo apt upgrade

Step 2 – Install MariaDB

Run the following command on terminal to install MariaDB on linux ubuntu system:

sudo apt install mariadb-server mariadb-client

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

sudo service mariadb status

Step 3 – Configure MariaDB

Run the following command on terminal 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 authorisation.

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 to all questions.

Step 4 – Test Installation Of MariaDB

Run the following command on terminal to check the status of mariaDB:

sudo mysqladmin version

Conclusion

In this tutorial, i have shown to you how to install and configure MariaDB on Linux ubuntu 22.04.

More Tutorials

Leave a Comment