Posted on

Checking for InnoDB in your application

Tip of the day… if your application uses features such as transactions or foreign keys, and you use the InnoDB storage engine for some (or all) of the tables, do
SHOW VARIABLES LIKE “have_innodb”
and check for
have_innodb having the value of YES
at the start of your application.
That covers InnoDB not having been excluded during compile (shown as NO), nor disabled in config (shown as DISABLED). Depending on your distribution of the MySQL server, such cases happen quite frequently, and of course you want your application to a) be immune to this and b) alert the user so the config be fixed.
Good programming practice!

Any version 4.0 or up of MySQL Server has InnoDB compiled in by default. For older versions (3.23), this was optional. InnoDB is a standard part of the server, and not meant to be excluded for normal operation. MySQL has a modular architecture, allowing certain standard features to be excluded/disabled for embedded and other applications that have specific requirements.

Posted on