Show tables by engine in MySQL

MysqlStorage Engines

Mysql Problem Overview


How would I show all tables in MySQL with a given engine, e.g. InnoDB, MyISAM, FEDERATED?

Mysql Solutions


Solution 1 - Mysql

Use http://dev.mysql.com/doc/refman/5.4/en/tables-table.html">`INFORMATION_SCHEMA.TABLES`</a> table:

SELECT table_name FROM INFORMATION_SCHEMA.TABLES
  WHERE engine = 'InnoDB'

Solution 2 - Mysql

If you want the results from a single database

SELECT TABLE_NAME FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = 'dbname' AND engine = 'InnoDB';

Solution 3 - Mysql

Other examples here.

All tables by engine (except system tables):

SELECT TABLE_SCHEMA as DbName ,TABLE_NAME as TableName ,ENGINE as Engine 
FROM information_schema.TABLES 
WHERE ENGINE = 'MyISAM' -- or InnoDB or whatever
AND TABLE_SCHEMA NOT IN('mysql','information_schema','performance_schema');

All tables except engine (except system tables):

SELECT TABLE_SCHEMA as DbName ,TABLE_NAME as TableName ,ENGINE as Engine 
FROM information_schema.TABLES 
WHERE ENGINE != 'MyISAM' -- or InnoDB or whatever
AND TABLE_SCHEMA NOT IN('mysql','information_schema','performance_schema');

Solution 4 - Mysql

If some has problem and want to see in which DB is tables with specific engine

SELECT 
		(SELECT group_concat(TABLE_NAME) 
            FROM information_schema.TABLES
		    WHERE TABLE_SCHEMA = 'database1' 
            AND engine = 'MyIsam'
        ) as database1, 
		(SELECT group_concat(TABLE_NAME) 
            FROM information_schema.TABLES
		    WHERE TABLE_SCHEMA = 'database2' 
            AND engine = 'MyIsam'
        ) as database2,
		(SELECT group_concat(TABLE_NAME) 
            FROM information_schema.TABLES
		    WHERE TABLE_SCHEMA = 'database3' 
            AND engine = 'MyIsam'
         ) as database3;

Regards.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKit PetersView Question on Stackoverflow
Solution 1 - MysqlChssPly76View Answer on Stackoverflow
Solution 2 - MysqlAlvinView Answer on Stackoverflow
Solution 3 - MysqlMTKView Answer on Stackoverflow
Solution 4 - MysqlStevan TosicView Answer on Stackoverflow