Score:0

MariaDB doesn't start after server restart

cn flag

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

Score:0
lr flag

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>

Score:0
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.