Install MariaDB on Debian 9

Posted by Morgan Billingsley on December 30, 2019 5:52 pm

The best way to install the latest version of MariaDB on any linux distribution is to visit https://downloads.mariadb.org/mariadb/repositories, select your operating system and its version, and then copy and paste the corresponding commands.

Step 1: Download key and repository

sudo apt-get install software-properties-common dirmngr
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.osuosl.org/pub/mariadb/repo/10.4/debian stretch main'

Update apt:

sudo apt update

Step 2: Install MariaDB server

sudo apt-get install mariadb-server

Check to see if MariaDB was installed properly by running:

sudo systemctl status mariadb

You should see something like this:

mariadb.service - MariaDB 10.4.11 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: 
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Mon XXXX-XX-XX XX:XX:XX UTC; Xh XXmin ago