I am calculating my InnoDB database's size with the following syntax:
SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
As per MySQL documentation, data_length column gives the clustered index length in pages. But I have not created an index on that table. How to calculate exact total space, used space and free space for a table?