Error:

Unknown table engine 'InnoDB'

What happened ?

I edited the file /etc/mysql/my.cnf by adding these lines:

innodb_file_per_table
innodb_buffer_pool_size=12G
innodb_additional_mem_pool_size=20M
innodb_flush_method=O_DIRECT

Then I restarted mysql and after that I noted the website was not working correctly due an error in the mysql related to the innodb engine not found. So I typed this command in mysql prompt:

SHOW ENGINES;

The output showed no InnoDB engine!

mysql> SHOW ENGINES;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
7 rows in set (0.00 sec)

To fix this issue, you need simply to comment all the new changes you made to /etc/mysql/my.cnf file and restart again mysql process with “/etc/init.d/mysql restart”, then login to mysql prompt and type:

SHOW ENGINES;

You should now see InnoDB:

mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |

Problem solved!

Incoming search terms: