I am trying to calculate the total size of all tables in mysql:
SELECT sum( data_length + index_length ) / 1024 / 1024 "Mb" FROM information_schema.TABLES;
+--------------+
| Mb |
+--------------+
| 942.02298263 |
+--------------+
The size of /opt/mysql5/data/ibdata is 3.1 GB. Why is there such a difference between the two numbers?