Categories: Ubuntu 18.04

How To Install MariaDB on Ubuntu 18.04 LTS

MariaDB is an enhanced, drop-in replacement for MySQL. MariaDB can be a better choice for database professionals looking for a robust, scalable, and reliable SQL server. MariaDB has a number of updated features over MySQL.

This article will help you to Install MariaDB 10.3 on Ubuntu 18.04 LTS via apt package manager. After installing MariaDB you may need to install phpMyAdmin to access database on the web interface.

Step 1 – Prerequsiteis

You can find the MariaDB Apt configuration file from the official website.

Sponsored
Import the package singin key for MaraiDB packages on your system.
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

After this, create a new Apt configuration file for MariaDB with the following command. You can use any text editor than vim.

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 repository to your system and use following commands to install MariaDB-server on your Ubuntu system. This will remove any previous version of MariaDB packages and install the latest packages on the system. Make sure you have proper backups of databases before running below commands.

sudo apt update
sudo apt install mariadb-server

This will also install other required dependencies on your system.

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

This will also ask for confirm password. Enter the same as above.

Sponsored

Step 3 – Verify MariaDB Setup

After successful installation of MariaDB on Ubuntu 18.04 system. The installer will also start service during the install process. You can verify service by running below command.

MariaDB also creates a reference of service with name mysql. You can change mariadb with mysql as per your choice.

sudo systemctl status mariadb

You will see running status like:

Then connect to MariaDB shell by running below command. You need to enter password configured in the above step.

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

Sometimes you need to stop or start MariaDB service. Use the following commands to stop, start, check 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 

Step 5 – What Next?

You may need to install phpMyAdmin on your system to access the MariaDB database on the web interface. Use below link to install phpMyAdmin.

https://tecadmin.net/install-phpmyadmin-in-ubuntu/

The post How To Install MariaDB on Ubuntu 18.04 LTS appeared first on TecAdmin.

Go to Source
Author: Rahul

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

5 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago