mysqlinnodbmyisamstorage-engines

How do I know if a mysql table is using myISAM or InnoDB Engine?


In MySQL, there is no way to specify a storage engine for a certain database, only for single tables. However, you can specify a storage engine to be used during one session with:

SET storage_engine=InnoDB;

So you don't have to specify it for each table.

How do I confirm, if indeed all the tables are using InnoDB?


Solution

  • If you use SHOW CREATE TABLE, you have to parse the engine out of the query.

    Selecting from the INFORMATION_SCHEMA database is poor practice, as the devs reserve the right to change its schema at any time (though it is unlikely).

    The correct query to use is SHOW TABLE STATUS - you can get information on all the tables in a database:

    SHOW TABLE STATUS FROM `database`;
    

    Or for a specific table:

    SHOW TABLE STATUS FROM `database` LIKE 'tablename';
    

    One of the columns you will get back is Engine.