×

Sometimes, in the process of starting the installation of MariaDB on your CentOS 8 system,  you can fail to start the MariaDB services on your system. 

This error happens when there is an issue with the MariaDB installation.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform MariaDB related errors.

In this context, we will look into how to resolve this MariaDB error.


Nature of MariaDB error "Job for mariadb.service failed because the control process exited with error code" ?

When this error occurs, you will see an error message such as this:

Job for mariadb.service failed because the control process exited with error code
See “systemctl status mariadb.service” and “journalctl -xe” for details.

You will observe the above error when you try to start the MariaDB services on your system by running the below-given commands:

$ sudo systemctl start mariadb.service
$ sudo systemctl status mariadb.service


How to fix MariaDB error "Job for mariadb.service failed because the control process exited with error code" ?

To resolve the above-mentioned problem, you need to implement some set of commands on the terminal. 

i. Navigate into the data directories and list all files by using the following commands:

$ cd /var/lib/mysql
$ ls

ii. Remove all data from the directories.

$ rm -r *

iii. Again initialize the database directory by running the following command:

$ mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

iv. Start the mysqld by executing the following commands:

$ sudo systemctl start mysqld

v. Now, again start the MariaDB and msql service.

$ sudo systemctl start mysql.service
$ sudo systemctl start mariadb.service

You need to authenticate the user login password. Enter the password.


vi. To get the service status run the below-given command:

$ sudo systemctl status mariadb.service


[Need urgent assistance to fix MariaDB related errors? We are available to help you today. ]


Conclusion