Mariadb not starting question

Hi @Inderpreet is reinstallation of mariadb necessary in this scenario or do i just need to change the directory location for sql?

@akshayyw re-installation isn’t necessary I think, it can be fixed without that.

2 Likes

remove the content of inside mysql directory as per shown in error.

thor@jump_host /$ ssh peter@stdb01

peter@stdb01 ~]$ sudo su -

root@stdb01 ~]# sudo systemctl start mariadb

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

root@stdb01 ~]# mysql_install_db

root@stdb01 mysql]# sudo chown mysql:mysql mysql/

root@stdb01 lib]# sudo systemctl start mariadb
[root@stdb01 lib]# sudo systemctl status mariadb

1 Like

Try #mysql_secure_installation and then try starting the service.

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.

No need to run any mysql commands or delete any files. You just need to fix the permissions.

You just need to change permissions to the /var/log/mariadb/ folder. Assign Mysql as owner to that folder.

I tried all of these but didn’t work for me. But then i tried myself and here is the solution: MariaDB Troubleshooting KodeKloud

Can you please let me know what might be the error, i am unable to understand. I have attached the screenshots

Hi Yogendra,

I solved the issue by running “yum update”.

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.

Thanks,
Chance

Error is because of mariadb-libs dependency. Please try to reinstall or do an yum update.

  1. yum remove mariadb
  2. yum install mariadb mariadb-server
  3. sudo systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-09-17 00:30:12 UTC; 30s ago
 Main PID: 500 (mysqld_safe)
   CGroup: /docker/3d00baec912265d7c5f343e44754fde1e8649860577c6184ad8453eea7cd4bcb/system.slice/mariadb.service
           ├─500 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─661 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=...

worked for me!