MariaDB Entry Level Tutorial


Steps:

  1. Update package lists
  2. Install MariaDB 10.1 (As of July 17, 2019)
  3. Start MariaDB Server
  4. Enable persistence


Update package lists

Update your package lists by issuing the command
time(sudo apt update && sudo apt dist-upgrade -y)
The section in pink, indicates that this part of the command is optional. We chose it, because it keeps the function wrapped together. It basically is just habit for us.

Install MariaDB using apt

Install your MariaDB Server by issuing the command
sudo apt install mariadb-server -y
The section in pink, indicates that this part of the command is optional. We chose it, because it keeps the function wrapped together. It basically is just habit for us.

After installing MariaDB, you will want to change a few things and restart it. The first thing being, /etc/mysql/mariadb.conf.d/50-server.cnf to force the server to use the utf-8 charset for the collation.

Issue the command: sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Change lines 111 & 112 to reflect:
character-set-server = utf8
#collation-server = utf8mb4_general_ci

Also you will want to restart the server instance using: systemctl restart mysql

Secure the installation

MariaDB comes with a built in script that will help secure the server immediately. Issue the command:
mysql_secure_installation

This will give you a list of questions you should answer. The answers should ALL be y or Yes.

Making it stick...

To make sure MariaDB starts up after each reboot issue the command:
systemctl enable mysql