MariaDB failed to start errors literally make websites standstill.
One of the typical error is Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
Unfortunately, this error may happen once the MariaDB installation has gone wrong or when an option file contains an invalid option, etc.
At Bobcares, we often get requests from our customers to fix MariaDB failed to start error as part of our Server Management Services.
Today, let’s get into the details on how our Support Engineers fix these errors.
Why MariaDB failed to start error?
There are many reasons that cause MariaDB to fail to start.
How do you find the reasons that make MariaDB fail to start?
This is where the error log comes as a help. Whenever we try to restart the MariaDB, the reason for the failure will certainly be written in the error log.
In Linux, the error log located in /var/log/mysql and C:\Program Files\MariaDB x.y\data for Windows.
Some common reasons include,
- Invalid option or option Value in the option file.
- When the critical system tables are either missing or are in the wrong location.
- Permission error on the directory.
- InnoDB crash.
Here, let’s see how our Support Engineers fix these problems.
MariaDB failed to start – How we fixed
At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems with the MariaDB
Now, let’s see the major reasons for MariaDB
1. Invalid option or option Value in the option file
Sometimes, the bad configuration settings in the option file block the MariaDB from start. Also, the default option file is called my.cnf.
We can check which configuration options MariaDB server will use from its option files by running the following command.
mysqld --print-defaults
Whenever an option file contains an invalid option or an invalid option value, it doesn’t allow MariaDB to start.
Occasionally, this may happen when we upgrade to a new version of MariaDB, because the valid values for options may change in new versions of MariaDB.
Then, the error may show the following error.
140514 12:19:37 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'option=value'.
This error indicates that valid values in an option file may change. Then, our Support Engineers make sure that the option file is set up as correctly or not.
When the option is completely invalid, we remove it from the option file and if the option’s name has changed, then we fix the name. Also, we change the option’s value to a valid one, if the option’s valid values have changed.
In addition, the error may arise due to a simple typo. So, we will then fix the typo.
2. Missing system tables
Similarly, missing system tables can also result in MariaDB failure.
In such cases, while checking the error log, we often see the following error.
System error 1067 has occurred.
Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
This error says that the critical system tables are either missing or are in the wrong location. Usually, it occurs after the MariaDB upgrade, if the option files set the basedir or datadir to a non-standard location and still the new server is using the default location.
Therefore, our Support Engineers make sure that the basedir and datadir variables are correctly set.
3. Improper MariaDB installation
Recently, one of our customers had a problem with his SQL Server. He got an error when he tried to start the MariaDB. The error said,
"Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details".
So. our Support Engineers installed the MariaDB properly as below.
1. Initially, we uninstalled the mariadb, maridb-server packages.
2. Then, we removed the directory /var/lib/mysql and reinstalled the Mariadb, Mariadb-server packages.
3. At last, we enabled and started the mariadb service.
systemctl enable mariadb
systemct start mariadb
This is how we fixed the error.
[Need assistance to fix MariaDB
Conclusion
In short, there are many reasons that MariaDB fails to start. It occurs once the MariaDB installation has gone wrong or when an option file contains an invalid option or an invalid option value and etc. Today, we saw how our Support Engineers assisted our customers to solve the error.
0 Comments