0

I have installed MariaDB on Ubuntu 20.0 where Mysql was installed already. I have removed MySql before installing MariaDB. I had to run command aa-remove-unknown and then sudo service mariadb start only then the DB server starts. This was working fine until a server restart today.

MariaDB doesn't seem to start and I noticed the following logs

sudo service mariadb start

Failed to start mariadb.service: Unit mariadb.service has a bad unit file setting.
See system logs and 'systemctl status mariadb.service' for details.

So I did

systemctl status mariadb.service that showed

mariadb.service: Unit configuration has fatal error, unit will not be started.

I noticed that the mysqld.sock file is missing but people say it will be created only when mariadb start and removed when server shutsdown.

I got it working only once by doing this

/etc/init.d/mysqld_safe

Upon running the above command mariadb started running and I was able to access the databases. I tried to do it again after a server restart but the command doesn't seem to start MariaDB anymore.

I have stage applications consuming databases and the development is now on hold. Your help will be greatly appreciated.

Thanks

2 Answers2

0

Unit mariadb.service has a bad unit file setting. generally means that your systemd file is messed up. It's possible that the unit file has corrupted. You should be able to inspect it, and make modifications to it as required.

Usually unit files are in /etc/system/systemd/<applicationName>

Barnabas Busa
  • 772
  • 6
  • 10
0

if you launch systemctl status mariadb you should see more output than just:

mariadb.service: Unit configuration has fatal error, unit will not be started.

You can see the unit file on the line:

Loaded: loaded (path/to/mariadb.service; enabled; vendor preset: disabled)

You will then need to check the unit file and understand what's blocking the service from starting.