How to fix ‘Unknown table engine ‘innodb” error
InnoDB is a storage engine for MySQL. Due to its speedy crash recovery, InnoDB is the preferred engine for high available databases.
But there are times when InnoDB throws error, such as ‘Unknown table engine ‘innodb”. Today, we’ll see when and why this error happens and how to fix it.
What is ‘Unknown table engine ‘innodb” error?
The error message itself clearly says that MySQL service is unable to detect the InnoDB storage engine.
InnoDB engine error manifests itself in different situations:
1. Failure in creating InnoDB tables
Suppose you try to create a new table using the command (“CREATE TABLE t1 (a INT, b CHAR (20), PRIMARY KEY (a)) ENGINE=InnoDB;”).
The table creation fails giving the error –
ERROR 1286 (42000) at line 1: Unknown table engine 'innodb'.
Table creation or listing using PhpMyAdmin may also not work. It may not even list the InnoDB storage engine option but instead throw up this error.
2. Using MySQL commands that involve InnoDB
When InnoDB engine is disabled, using certain commands would show this error.
For instance, listing the storage engines using ‘show engines’ command, backing up the databases using mysqldump, etc. are situations where you may end up seeing this error:
mysqldump: Got error: 1286: Unknown table engine 'InnoDB' when using LOCK TABLES
3. MySQL server can fail to start
MySQL may not start with InnoDB engine support. The error shown in the log file would be:
[ERROR] Unknown/unsupported storage engine: InnoDB
4. Error in the websites
All of a sudden, all your database-driven websites can start giving the error along with the database queries:
Notice: Error: Unknown table engine 'InnoDB' Error No: 1286
What causes the error ‘Unknown table engine ‘innodb”
Unknown table engine error happens either because InnoDB storage engine is not enabled in the server or because it got corrupt.
The main reasons that cause the error are:
1. InnoDB not enabled
If the InnoDB engine is disabled in the MySQL database server configuration, it will give error ‘Unknown table engine ‘innodb” whenever you try to create a table with InnoDB support.
It can happen if the MySQL server is not compiled with InnoDB support or if the InnoDB support is disabled via configuration settings.
If the MySQL server was built from source and the built-in InnoDB wasn’t compiled in it, InnoDB engine will not be recognized.
You can check if InnoDB is supported in the server, using the MySQL command:
The value ‘DISABLED’ for ‘have_innodb’ parameter shows that InnoDB is not enabled in that server.
InnoDB engine can also get disabled as a result of a MySQL server upgrade, server migration or manual configuration changes.
If the parameter ‘skip-innodb’ is uncommented in /etc/my.cnf, it will skip loading the InnoDB database engine.
2. Memory shortage
Server not having enough memory to allocate to MySQL, can cause InnoDB to fail. Memory allocation happens based on the parameters such as ‘
If the value alloted for this pool size is greater than the available memory limit, InnoDB error occurs.
3. Huge or corrupt log files
In the long run, it so happens that the InnoDB log files grow in size of around GBs or they get corrupt due to some reason. The log files are available at ‘
These log files contain the changes to InnoDB data. If they get corrupt, InnoDB will fail to load and ends up giving the error ‘Unknown table engine ‘innodb”.
4. Incorrect permissions for /tmp or socket file
By default, the MySQL server creates its socket file in /tmp or other tmp folder as configured. This folder requires 1777 permissions, for the service to work.
If the /tmp doesn’t have enough permissions to create the socket file, it may end up showing the InnoDB error. InnoDB also fails to run if this folder is full and have no space left.
Bobcares provides Outsourced Hosting Support and Outsourced Server Management for online businesses. Our services include Hosting Support Services, server support, help desk support, live chat support and phone support.