How to install MariaDB 10 on Debian 9

Table of Contents
Install MariaDB on Debian 9
MariaDB is the fork of MySQL and backward compatible replacement for MySQL. Here in this tutorial, we are going to show you how to install MariaDB 10 on Debian server in the following ways:
1. Install MariaDB from Debian PPA
2. Install MariaDB from Official Repository.
In Debian 9’s main repository by default contains repository for MariaDB. So the first way is recommended by us to install MariaDB.
Prerequisites
Before you start installing MariaDB 10.3 on Debian 9. You must have the non-root user account on your server with sudo privileges.
1. Install MariaDB from PPA
As Debian by default has MariaDB repository in its main repository. You will first update package manager index then you will install MariaDB 10 on Debian.
To Update apt package manager index type following command.
sudo apt update
Install MariaDB server by typing following and hitting Enter.
sudo apt install mariadb-server
Now confirm the installation by typing following
mysql -V
The output should be :
mysql Ver 15.1 Distrib 10.3.8-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
After installation, MariaDB will start automatically. To check status type following command.
sudo systemctl status mariadb
The output should be :
● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset Active: active (running) since Sun 2018-10-11 14:15:57 UTC; 38s ago Main PID: 14532 (mysqld) Status: "Taking your SQL requests now..." Tasks: 27 (limit: 507) CGroup: /system.slice/mariadb.service └─14532 /usr/sbin/mysqld
2. Installing MariaDB from Official Repository
MariaDB officially supports installer for MariaDB. Here you will need to download it from one of the mirrors at MariaDB Download Page.
Import MariaDB key to your system by typing following
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
After Importing key add MariaDB repository
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.3/ubuntu bionic main'
Now update the apt package manager index by typing following
sudo apt update
Install MariaDB server by typing following and hitting Enter.
sudo apt install mariadb-server
Now confirm the installation by typing following
mysql -V
The output should be :
Output: mysql Ver 15.1 Distrib 10.3.8-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
After installation, MariaDB will start automatically. To check status type following command.
sudo systemctl status mariadb
3. Setting Up MariaDB
After installation, we have to improve MariaDB security by typing following
sudo mysql_secure_installation
NOTE: it is recommended to answer ‘Y’ for all questions asked during secure installation.
You can log in to MariaDB by typing
mysql -u root -p
Conclusion
You have successfully learned how to install MariaDB 10 on Debian 9. If you have any queries please don’t forget to comment out.
LATEST POSTS
-
How to Install Redis on Debian 9
-
How to install Django Web Framework on Debian 9
-
How to install Python on Ubuntu 18.04
-
How to Create Sudo User on Ubuntu
-
How to Install Node.js with npm on Debian 10
-
How to Install Dropbox on CentOS 8 Server
-
How to Install Apache on CentOS 7
-
How to Install Go on Linux Mint 19
-
How to Find and Replace Text in Vim or Vi
-
How to Install Apache on Linux Mint 19
-
How to Install Google Earth on Debian 10
-
How to Check CentOS Version