¿Cómo mostraría todas las tablas en MySQL con un motor determinado, por ejemplo, InnoDB, MyISAM, FEDERATED?
mysql
storage-engines
Kit Peters
fuente
fuente
Si desea los resultados de una sola base de datos
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dbname' AND engine = 'InnoDB';
fuente
Otros ejemplos aquí.
Todas las tablas por motor (excepto las tablas del sistema):
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');
Todas las tablas excepto el motor (excepto las tablas del sistema):
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');
fuente
Si alguno tiene problema y quiere ver en qué DB hay tablas con motor específico
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;
Saludos.
fuente