Tuesday, September 22, 2020

How to Install MariaDB on Debian 10 Linux Operating System

Must read

How to Change Hostname on Ubuntu 20.04 Linux

The hostname is known as the system's identifier, which is set at the time when we are installing the Ubuntu operating system.

How to Install Node.js and NPM on Debian 10 Linux

The Node.js is the very well-known JavaScript runtime environment used to JavaScript code server-side execution. It is an Open-source, cross-platform supported environment....

How to Install Go on Debian 10 Linux

Go is a very new and most popular open-source programming language; Google creates it. There are many popular software/applications developed using the...

How to Deploy Rocket.Chat on Debian 10 Linux

Rocket.Chat is a very popular open-source team communication system; it is famous as an alternative to Slack. It provides various features along...
SATISH KUMAR
I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.

MariaDB is a multi-thread, open-source relational database management system, a perfect replacement of MySQL database system. MariaDB maintained and developed by the MariaDB Foundation, including some of the MySQL developers.

Debian new release version 8 is coming with MariaDB default database system which is replacement of MySQL.

In this tutorial article, we will learn the methods to install MariaDB into Debian 10 operating system.

There are two methods to install MariaDB into Debian machine; one is use to directly install to Debian repository and another to use MariaDB repository to install the latest MariaDB package.

Prerequisites

Before starting MariaDB install into Debian machine, make sure you have a Debian 10 running machine and a user to login into the system with sudo privileges.

Install MariaDB on Debian 10 Server

You should follow below steps for MariaDB installation process on Debian 10 Server:

Step 1 – Update Debian 10 Repository

Before installing any new package on Debian 10 operating system first need to update the repository package list, which is performed by the following command:

$ sudo apt update

Step 2 – Install MariaDB

Once the repositories package list updated in your system, you can start the MariaDB installation using below command:

$ sudo apt install mariadb-server

Step 3 – Verify MariaDB Installation

You can verify MariaDB installation by checking the status of MariaDB service, as shown below:

$ sudo systemctl status mariadb

If MariaDB is installed and running properly, you will get output with Active and running status like below image.

MariaDB Install on Debian 10 using MariaDB Repository

If you want to install MariaDB latest version into your Debian 10 system which not released into default Debian 10 repositories, you can use MariaDB repository directly to install Latest MariaDB.

To install the Latest release of MariaDB on Debian 10 using MariaDB repository follow below steps:

Step 1 – Enable MariaDB Repository

To install MariaDB using MariaDB repository first need to enable MariaDB repository and import repository key by using the following command:

$ sudo apt install software-properties-common dirmngr
$ sudo apt-key adv --recv-keys --keyserver http://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.dotsrc.org/mariadb/repo/10.3/debian stretch main'

Step 2 – Update package List and install MariaDB

After enabling MariaDB repository need to update repository packages and install MariaDB server by using the following command:

$ sudo apt update
$ sudo apt install mariadb-server

Step 3 – Verify MariaDB Installation

Once MariaDB gets installed it services automatically get started, you can verify it by checking MariaDB service, as shown below:

$ sudo systemctl status mariadb

If MariaDB is running correctly you will get the screen with Active and running status as below image:

MariaDB Secure Installation

You need to run mysql_secure_installation script to secure MariaDB installation as shown below:

$ sudo mysql_secure_installation

This script will ask you to set the root user password, restrict root access to localhost, remove anonymous users, and remove the test database.

After completion of the script, it will reload privilege tables, and all the changes take effect immediately.

MariaDB Connection through CLI

To connect the MariaDB server through terminal or command-line interface, you should use mysql command as shown below:

$ mysql –u root –p

The above command will connect with MariaDB shell using the root user. The next screen will appear to enter the password for user root.

Once you get the connection with MariaDB shell you will get the screen as shown below image:

Conclusion

Now, we learned how to install MariaDB into Debian 10 machine. We also learned to install MariaDB directly from MariaDB repository, how to secure MariaDB installation and connect process from CLI.

If you have any doubt or issue with installation, feel free to leave comment below.

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to Change Hostname on Ubuntu 20.04 Linux

The hostname is known as the system's identifier, which is set at the time when we are installing the Ubuntu operating system.

How to Install Node.js and NPM on Debian 10 Linux

The Node.js is the very well-known JavaScript runtime environment used to JavaScript code server-side execution. It is an Open-source, cross-platform supported environment....

How to Install Go on Debian 10 Linux

Go is a very new and most popular open-source programming language; Google creates it. There are many popular software/applications developed using the...

How to Deploy Rocket.Chat on Debian 10 Linux

Rocket.Chat is a very popular open-source team communication system; it is famous as an alternative to Slack. It provides various features along...

How to Install Tomcat 9 on Ubuntu 20.04 Operating System

The Apache Tomcat software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. Apache...