• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install MariaDB on Debian 10 Buster

Written by Admin, Updated On May 16, 2020
debian, mariadb
How to Install MariaDB on Debian 10

MariaDB is a multi-threaded and open-source database management system which will organize and provide access to databases where your site can store information. It is a replacement of MySQL and developed by some of the original developers of the MySQL. With the release of Debian 9, MySQL was replaced with MariaDB as the default database system. In this tutorial we will show you how to install MariaDB on Debian 10 Buster.

Install MariaDB on Debian 10#

In this tutorial you will learn step by step how to install MariaDB on a Debian 10 server.

Prerequisites#

At first, you need Debian 9 server with a non-root sudo enabled user account.

Installing MariaDB#

By default, MariaDB version 10.3 is included on Debian 10 in the APT package repositories.

At first, update the package index on your server with apt.

sudo apt update

After that, install MariaDB server and client packages by  by typing :

sudo apt install mariadb-server

It will start automatically MariaDB service.

Verify MariaDB#

Run below command to check MariaDB service status:

sudo systemctl status mariadb

It will show output as following :

● mariadb.service - MariaDB 10.3.15 database server
 Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
 Active: active (running) since Fri 2019-07-12 11:32:30 UTC; 8min ago
     Docs: man:mysqld(8)
         https://mariadb.com/kb/en/library/systemd/
 Main PID: 4509 (mysqld)
 Status: "Taking your SQL requests now…"
     Tasks: 32 (limit: 4820)
 CGroup: /system.slice/mariadb.service
         4509 /usr/sbin/mysqld

Securing MariaDB#

To increase security of MariaDB installation run the included security script. This will remove less secure default options such as root remote login and remove sample users. Run the below command :

sudo mysql_secure_installation

At first, it will prompt you to enter current root user password. Next, it will ask you weather you want to change or set password for root. Press N and hit Enter key. After that it will prompt series of questions, press Y and hit Enter to accept the defaults for all the subsequent questions.

This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MariaDB immediately respects the changes you have made.

Connect to MariaDB from the command line#

You can also connect MariaDB server through the terminal as the root account by typing:

mysql -u root -p

You will be prompted to enter the root password. Enter root user password which you set at securing step.

Once you will enter correct password it will show MariaDB shell.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.3.15-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Conclusion #

You learned how to install and secure MariaDB on a Debian 10 server.

If you have any question or suggestion, leave comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Nginx on Debian 10 Linux
Next Article   How to Install Django on Ubuntu 18.04

Related Posts

  • How to Install Php 8 on Debian 10

    How to Install PHP 8 on Debian 10

    January 2, 2021
  • How to Install GIMP on Debian 10

    How to Install GIMP 2.10 on Debian 10

    December 27, 2020
  • How to Install Python 3.9 on Debian 10

    How to Install Python 3.9 on Debian 10

    December 25, 2020

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on Debian 10
    How to Install Python 3.9 on Debian 10 December 25, 2020
  • How to Install Python 3.9 on Ubuntu 20.04
    How to Install Python 3.9 on Ubuntu 20.04 December 21, 2020
  • How to Install GIMP on Ubuntu 20.04
    How to Install GIMP 2.10 on Ubuntu 20.04 December 22, 2020
  • How to Install Notepad++ on Debian 10
    How to Install Notepad++ on Debian 10 December 23, 2020
  • How to Install Php 8 on Debian 10
    How to Install PHP 8 on Debian 10 January 2, 2021
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook