Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.
clear all in /var/lib/mysql
After that try again to run command
root@stdb01 ~]# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
[root@stdb01 ~]# sudo systemctl start mariadb
[root@stdb01 ~]# sudo systemctl status mariadb
You should see an error in the journalctl logs that says it could not change ownership of a directory. It might help to do journalctl -xe | grep maria. Once you find that directory you just need to change the ownership on it manually and you will be able to start the service.
When you change the permissions you need to use sudo, just like any other command that needs elevated permissions.
I got exact error as you showed above and I couldn’t find any solution in google about “group is empty”. Still not sure what was the root cause though. If anyone could tell, that would be appreciated.
i thinks a few hints in the question or something would make it a bit easier for newbies to get it.
Elaborate in the question, maybe add “the DB service seems to have not been installed properly…” then that will sort of switch on a lot of light for a lot am sure!
Hello
I saw that for some user reinstall mariadb works
but I have question e.g. if I have production mariadb and reinstall it should i lose my db and data?
Even after starting mariadb ,it gets same error .So What I have done ,as follow:-
1)unistall mariadb and its server completly and install again ,then start and enable ,it will work: yum remove mariadb mariadb-server
2) remove its files and packages : rm -rf /var/lib/mysql
install again : 1. yum install mariadb mariadb-server
start : systemctl start mariadb , enable: systemctl enable mariadb
check the status : systemctl status mariadb
In my case, the only problem was the directory name was different.
journalctl -u mariadb.service
The problem was ‘’/var/lib/mysql is not empty’’ when I go that directory I found out that the directory name was mysqld instead of mysql.
mv /var/lib/mysqld /var/lib/mysql
it supposed to work now.
This worked for me.
We are not even able to see the logs (as the service has not created any log /var/log/maridb/mariadb.log is empty). After running the ExecStartPre script maunally & restarting the service we are able to generate the logs file as well.