MariaDB has earned its stripes as a reputable database management system due to its feature-rich and performant nature. It being a MySQL fork implies that MariaDB offers similar features and performance metrics with the advantage of being free and completely open-source.
Therefore, for users that are invested in web-based or desktop-based application development projects, the input that mariaDB brings to the table cannot be ignored.
Prerequisites
Be a root/sudoer user on the Ubuntu system you wish to install MariaDB database management software.
Installing MariaDB in Ubuntu
An updated system is a performant system, make sure your Ubuntu system is up-to-date with the latest software.
$ sudo apt update && sudo apt upgrade -y
Once your Ubuntu system is up-to-date, we can proceed and install MariaDB.
$ sudo apt install mariadb-server -y
The installation process should take a minute or two to complete due to MariaDB’s light nature. Next, confirm the installed version of MariaDB on your Ubuntu system.
$ mariadb --version
At this point, this article assumes you intend to use MariaDB as your primary database management software. We need to start and enable it so that it keeps on running even after the Ubuntu system shutdown or reboot.
$ sudo systemctl start mariadb $ sudo systemctl enable mariadb $ sudo systemctl status mariadb
Securing MariaDB in Ubuntu
The following MariaDB pre-configuration security script ensures that set the root database user password and other warranted database configurations like removing anonymous users, disallowing remote login, removing test databases, before you can start using it.
$ sudo mysql_secure_installation
Next, you need to log in to your database to test MariaDB.
$ sudo mysql -u root -p
Create a database user, database, and assign control over the created database to the user.
MariaDB [(none)]> CREATE USER linuxshelltips@localhost IDENTIFIED BY "Your_preferred_db_user_password"; MariaDB [(none)]> CREATE DATABASE linuxshelltips_db; MariaDB [(none)]> GRANT ALL ON linuxshelltips_db.* TO linuxshelltips@localhost; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit
This article has walked us through installing, securing, and testing MariaDB database management software on the Ubuntu system.