SELECT data_length+index_length table_size
FROM information_schema.tables
WHERE table_schema='whateverdatabase'
AND table_name='whatevertablename*'
AND engine IS NOT NULL;
This works for any table; does not work with views (IS NULL engine).
source
share