Simple query to get count of all tables in database, as real data:
SET @tableSchema = 'my_schema'; SET SESSION group_concat_max_len = 10000000; SET @rowCounts = ( SELECT group_concat(CONCAT('SELECT ''',TABLE_NAME,''', COUNT(*) FROM ', TABLE_NAME) SEPARATOR ' union all ') FROM information_schema.tables WHERE table_schema = @tableSchema ); PREPARE statement FROM @rowCounts; EXECUTE statement; -- don't run dealloc until you've exported your results ;) DEALLOCATE PREPARE statement;
It is also possible to use:
SELECT TABLE_NAME, TABLE_ROWS FROM `information_schema`.`tables` WHERE `table_schema` = 'YOUR_DB_NAME';
but it gives only estimates