# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code.
See “systemctl status mariadb.service” and “journalctl -xeu mariadb.service” for details.
System Info Below:
# cat /etc/os-release
NAME=”CentOS Stream”
VERSION=”9″
ID=”centos”
ID_LIKE=”rhel fedora”
VERSION_ID=”9″
PLATFORM_ID=”platform:el9″
PRETTY_NAME=”CentOS Stream 9″
ANSI_COLOR=”0;31″
LOGO=”fedora-logo-icon”
CPE_NAME=”cpe:/o:centos:centos:9″
HOME_URL=”https://centos.org/”
BUG_REPORT_URL=”https://bugzilla.redhat.com/”
REDHAT_SUPPORT_PRODUCT=”Red Hat Enterprise Linux 9″
REDHAT_SUPPORT_PRODUCT_VERSION=”CentOS Stream”
The issue could be that MariaDB instance is conflicting with a previous or current instance of MySQL already or previously running on your server.
Use this command to get more details:
# systemctl status mariadb
From the output above, these lines in the log are of interest:
Jul 05 10:49:38 ss-nyk-ebu-mon-svr-01 systemd[1]: Starting MariaDB 10.5 database server…
Jul 05 10:49:38 ss-nyk-ebu-mon-svr-01 mariadb-prepare-db-dir[227630]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Jul 05 10:49:38 ss-nyk-ebu-mon-svr-01 mariadb-prepare-db-dir[227630]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
To resolve this, go to this directory “/var/lib/mysql”
# cd /var/lib/mysql
And remove all the contents in this directory, and try to start mariadb again:
# rm -rf /var/lib/mysql/*
# ls -ltr
total 0
# systemctl start mariadb