Exact count of all rows in MySQL database

database, innodb, mysql, sql

Solution

I think the only accurate (and slower) way is to do for every single table:

SELECT COUNT(*) FROM Table

Problem

I'm currently using the script ``` SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'Tables'; ``` However, it's not accurate, because the engine used by my MySQL tables is InnoDB (I only realised this could be an issue now, be these databases have existed for a while). Is there any way to get an exact count of every row in every table of a database with MySQL? Cheers.

Original source

Related problems