Missing MySQL Service in Services Management

Unable to restart mariadb, Unit mariadb.service not found.

Missing MySQL Service in Services Management because, accidentally uninstalled the mariadb servers. Reinstall the previous mariadb version, Here is an example for MariaDB 10.11 with AlmaLinux 8 use RHEL 8:

Configure MariaDB repository: open the Setting MariaDB repositories page, select your OS distro (for AlmaLinux 8 use RHEL 8), release, and desired MariaDB version. Once done, the configuration that should be added to the /etc/yum.repos.d/MariaDB.repo file will appear.

 

1. Open/create the MariaDB.repo file in any text editor. In this example, we are using the vi editor:

vi /etc/yum.repos.d/MariaDB.repo

 

2. Add the content below to the file:

# MariaDB 10.11 RedHatEnterpriseLinux repository list - created 2023-11-26 00:53 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/10.11/rhel/$releasever/$basearch
baseurl = https://download.nus.edu.sg/mirror/mariadb/yum/10.11/rhel/$releasever/$basearch
module_hotfixes = 1
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://download.nus.edu.sg/mirror/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1

3. After the file is in place, install and start MariaDB with:

# sudo yum clean all
# sudo yum install MariaDB-server MariaDB-client

 

4. Restart MySQL service:

service mysql restart || service mariadb restart || service mysqld restart 
Was this answer helpful?