MariaDB will not start: Plugin 'InnoDB' registration as a STORAGE ENGINE failed
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.Short answer
This line is a symptom, not the cause: InnoDB failed to start and the server gave up. The real reason is a few lines earlier in the error log. Two documented ones are a missing or invalid ib_logfile0 (MariaDB 10.8.1 and later) and a data directory that needs InnoDB forced recovery after a crash.
Fix it fast
1Find out which cause you have
Read the first InnoDB error in the log, not the registration line. It sits above it and names the cause.
sudo journalctl -u mariadb --no-pager -n 802Match what you see, then jump to its fix
- 1
An InnoDB line about ib_logfile0 (missing, invalid or 'too small') comes before the registration error.The redo log file ib_logfile0 was deleted, damaged or is too smallFix - 2
The log shows corruption or recovery failures right before the registration error.The data directory is damaged after a crash and InnoDB cannot recover normallyFix
- 1
What does the error look like?
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.[ERROR] InnoDB: File ./ib_logfile0 is too small[ERROR] Unknown/unsupported storage engine: InnoDB
Cause 1 of 2
The redo log file ib_logfile0 was deleted, damaged or is too small
1Check
From MariaDB 10.8.1 InnoDB needs ib_logfile0 to exist and be valid to start; the server refuses to start when it is missing. A file below the minimum size is rejected with 'File ./ib_logfile0 is too small'. Old advice to delete the redo log files to resize them no longer works.
sudo ls -l /var/lib/mysql/ib_logfile02Fix
Do not delete it again. Stop the server, and put back the original ib_logfile0 from a copy of the data directory made before it was removed. Resize the log later with innodb_log_file_size on a running server (dynamic from MariaDB 10.9), not by removing the file.
sudo systemctl stop mariadb
sudo cp -a /backup/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0
sudo chown mysql:mysql /var/lib/mysql/ib_logfile0
sudo systemctl start mariadb3Verify
The service starts and the log has no InnoDB errors.
sudo systemctl status mariadb --no-pagerConfirmed by mariadb.com
Cause 2 of 2
The data directory is damaged after a crash and InnoDB cannot recover normally
1Check
MariaDB's recovery-modes page defines innodb_force_recovery levels 1 to 6. It says to try 1, and if the server still fails, 2, and so on.
sudo grep -i innodb /var/log/mysql/error.log | tail -n 302Fix
Copy the data directory first. Add innodb_force_recovery=1 under [mariadbd], start the server, and raise the value one step at a time only if it still fails. Once it runs, dump everything with mariadb-dump, then rebuild from the dump as the page describes.
# /etc/mysql/mariadb.conf.d/99-recovery.cnf
[mariadbd]
innodb_force_recovery = 1
mariadb-dump --all-databases > /root/all-databases.sql3Verify
The dump file is created and the server answers queries while recovery mode is on.
ls -lh /root/all-databases.sqlConfirmed by mariadb.com
How do I stop it coming back?
- Never delete ib_logfile0 or other InnoDB files by hand; change innodb_log_file_size through the server.
- Take a copy of the data directory before any recovery step.
- Keep recovery mode temporary: dump, remove the setting, and restore from the dump.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
An EC2 instance cannot reach its RDS database
Could not open connection to the host, on port <port>: Connect failed
RDS denies all access until a security group allows it.
3 causes, each with a fixDatabases
Locked out of a fresh MariaDB install as root on Mac or Linux
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
A fresh MariaDB root account is not a normal password account.
3 causes, each with a fixDatabases
An Aria table fails with 'Read page with wrong checksum' (error 1030, code 176)
ERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria
Code 176 means MariaDB's Aria engine read a data or index page whose checksum does not match, so that table file is damaged.
3 causes, each with a fixDatabases
The client cannot open a TCP connection to MariaDB or MySQL (error 2003)
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
Error 2003 means the client tried a TCP connection to the host and port and nobody answered.
4 causes, each with a fix