#!/bin/bash
set -euo pipefail

sudo pacman -S --noconfirm --needed mariadb

if [[ ! -d /var/lib/mysql/mysql ]]; then
    sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
fi

sudo systemctl enable --now mariadb.service
