• 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 Ubuntu 20.04

Written by Admin, Updated On May 18, 2020
mariadb, ubuntu
How to Install MariaDB on Ubuntu 20.04

MariaDB is a multi-threaded and open-source database management system which used as alternate of MySQL. It’s developed by some of the original developers of the MySQL. This tutorial covers how to install MariaDB on Ubuntu 20.04.

  • Read : How to Install MySQL on Ubuntu 20.04

Prerequisites#

You must logged in as root or non-root sudo enabled user account.

Step 1 – Installing MariaDB#

By default, Ubuntu 20.04 APT repositories includes MariaDB version 10.3.

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.

Step 2 – 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

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.

Step 3 – Verify MariaDB#

Run below command to check MariaDB service status:

sudo systemctl status mariadb

It will show output something like this:

● mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-05-12 13:38:18 UTC; 3min 55s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 25914 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 31 (limit: 2345)
     Memory: 65.6M

Step 4 – Connect to MariaDB#

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 8
Server version: 10.3.22-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 #

This tutorial shown you how to install and secure MariaDB on a Ubuntu 20.04 server.

If you have any question or suggestion, please 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 Ruby on CentOS 8 / RHEL 8
Next Article   How to Install Yarn on Debian 10 Buster

Related Posts

  • How to Install WordPress with Nginx on Debian 11

    How to Install WordPress with Nginx on Debian 11

    March 22, 2023
  • How to Install Apache, MySQL, PHP (LAMP) on Ubuntu 22.04

    How to Install LAMP on Ubuntu 22.04

    March 20, 2023
  • How to Install LEMP Stack on Ubuntu 22.04

    How to Install LEMP Stack on Ubuntu 22.04

    March 18, 2023

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 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