Mariadb-Server

In this blog will help you to Install MariaDB 10.3 on Ubuntu 18.04 LTS  using apt package manager. After installing MariaDB you need to install phpMyAdmin or use Adminer for access the database on the web interface.

Step 1 – Prerequsiteis

We can Find the MariaDB Apt configuration file from the official website. Import the package sign in key for MariaDB packages on your Ubuntu Server.

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Now we will create a new Apt configuration file for MariaDB with the using below repo.

$ sudo vim /etc/apt/sources.list.d/mariadb.list

# MariaDB 10.3 Repository
deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main
deb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main

 

 

Step 2 – Install MariaDB on Ubuntu 18.04

After adding the MariaDB repo to your ubuntu server and use these commands to install MariaDB-server on your Ubuntu 18.04 Server. First you need to remove the previous version of MariaDB packages in your system then  install the latest packages on the Ubuntu Server. First, Make sure you have proper backups of databases before running below commands.

$ sudo apt update 
$ sudo apt install -y mariadb-server

 

 

While installing MariaDB using above command installer will prompt  MariaDB root account password. Enter a strong password.

 

Also, ask for confirm password. Enter the same as above.

Step 3 – Verify MariaDB Setup

When the successful installation of MariaDB on Ubuntu 18.04 Server.

Start Maridab using this command:

$ sudo systmectl status mariadb

check Mariadb status using this command:

$ sudo systmectl status mariadb

 

You will see running status is Active

 

Login Mariadb using below command

mysql -u root -p

Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 47 Server version: 10.3.10-MariaDB-1:10.3.10+maria~bionic mariadb.org binary distribution 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)]>

 

Step 4 – Manage MariaDB Service

Use the below commands to stop, start, check the status and restart MariaDB service.

$ sudo systemctl stop    mariadb.service       # To Stop MariaDB service 
$ sudo systemctl start   mariadb.service       # To Start MariaDB service 
$ sudo systemctl status  mariadb.service       # To Check MariaDB service status 
$ sudo systemctl restart mariadb.service       # To Stop then Start MariaDB service