Fixing a “Failed to start MariaDB” Error: The Aria Engine Problem
If you’ve ever found your MariaDB server refusing to start with a cryptic exit-code
and an error log filled with messages about the Aria storage engine, you’re not alone. This is a common issue that can be frustrating, especially if you’re not sure where to look. At prenhost, we’ve helped countless users navigate this problem. Here’s a quick guide on how to diagnose and fix it so you’re prepared if it happens again.
1. Identify the Problem with the Error Log
The first and most crucial step is to look at the MariaDB error log. The systemctl
status output is too generic to be helpful on its own.
- Your
systemctl
status shows a failure.Bashsystemctl status mariadb.service
This will show
Active: failed (Result: exit-code)
. - The error log is the key. The
log-error
path in your/etc/my.cnf
file tells you exactly where to look.Bashtail -n 50 /var/lib/mysql/your-error-log-name.err
- Spot the critical error messages. You’ll know it’s the Aria issue if you see these lines in your log:
[ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'".
[ERROR] mariadbd: Aria recovery failed. Please run aria_chk -r on all Aria tables (*.MAI) and delete all aria_log.######## files
These messages confirm that the Aria storage engine—which is used for MariaDB’s internal system tables—has become corrupted.
2. The Solution: Repair the Corrupted Aria Tables
MariaDB provides a dedicated tool, aria_chk
, specifically for this purpose. This tool can check and repair the corrupted Aria tables.
- Stop the MariaDB service. This is essential to prevent the database from making further changes while you’re working on the files.
Bash
systemctl stop mariadb.service
- Navigate to your data directory. Aria table files are located in MariaDB’s data directory, typically
/var/lib/mysql
.Bashcd /var/lib/mysql
- Run
aria_chk
to repair the tables. The log specifically mentionsmysql.plugin
, so start there.Basharia_chk -r mysql/plugin.MAI
You may need to run this on other
.MAI
files if they also show corruption in the logs. - Remove the Aria log files. The error log also recommends deleting the log files to ensure a clean recovery.
Bash
rm -f aria_log.*
3. Restart and Verify the Service
With the corrupted files repaired, you can now try to restart the MariaDB service.
- Start the MariaDB service.
Bash
systemctl start mariadb.service
- Check the status again. A green,
active (running)
status means you’ve successfully fixed the problem.Bashsystemctl status mariadb.service
Conclusion
Diagnosing a MariaDB startup failure can be intimidating, but by knowing where to look—the error log—and understanding the key error messages, you can quickly identify and fix the issue. The Aria storage engine corruption is a common culprit, and the aria_chk
tool is your best friend in this scenario. For more tips and hosting solutions that prioritize stability and support, check out prenhost.