If you are getting this error so first check if InnoDB is enabled or not using following steps,
root@server[~]# mysql
SHOW ENGINES;
Above command will give you following output
mysql> SHOW ENGINES; +------------+---------+----------------------------------------------------------------+ | Engine | Support | Comment | +------------+---------+----------------------------------------------------------------+ | MyISAM | YES | Default engine as of MySQL 3.23 with great performance | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | | InnoDB | DISABLED| Supports transactions, row-level locking, and foreign keys | | BerkeleyDB | NO | Supports transactions and page-level locking | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | | EXAMPLE | YES | Example storage engine | | ARCHIVE | YES | Archive storage engine | | CSV | YES | CSV storage engine | | ndbcluster | NO | Clustered, fault-tolerant, memory-based tables | | FEDERATED | YES | Federated MySQL storage engine | | MRG_MYISAM | YES | Collection of identical MyISAM tables | | ISAM | NO | Obsolete storage engine | +------------+---------+----------------------------------------------------------------+ 12 rows in set (0.00 sec)
Then you can check if its disabled in my.cnf
vi /etc/my.cnfskip-innodb
Comment the above line in my.cnf using #
skip-innodb
If you cant see this line then add the following line in my.cnf
default-storage_engine=InnoDB
and then restart mysql service
service mysql restart
Now your default storage engine is set to InnoDB