Saturday, April 10, 2010

View All Tables Record Counts in MySQL

To view all tables record counts in MySQL simply use this command

SELECT table_name, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'database_name';

edit: it seems like the result returned is a cached result and it is not accurate, if you are looking for accurate result, I don't recommend the above mentioned approach.