If you need to determine if InnoDB is enabled when querying the database, you should use the INFORMATION_SCHEMA tables.
SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'InnoDB';
What if InnoDB is enabled and is the default database gives the result
+---------+ | SUPPORT | +---------+ | DEFAULT | +---------+
If InnoDB is available but not the default engine, the result will be YES
. If it is not available, the result will obviously be NO
.
See http://dev.mysql.com/doc/refman/5.5/en/engines-table.html and http://dev.mysql.com/doc/refman/5.5/en/information-schema.html for Help.
When InnoDB is available, the INFORMATION_SCHEMA tables mentioned in the comment are also available.
SHOW TABLES FROM INFORMATION_SCHEMA LIKE 'INNODB%'; +----------------------------------------+ | Tables_in_INFORMATION_SCHEMA (INNODB%) | +----------------------------------------+ | INNODB_CMP_RESET | | INNODB_TRX | | INNODB_CMPMEM_RESET | | INNODB_LOCK_WAITS | | INNODB_CMPMEM | | INNODB_CMP | | INNODB_LOCKS | +----------------------------------------+
source share