MySQL: Determine the Size of Each Table in a Database

2/15/2021 8:04:56 PM

select * from 
(
	SELECT 	TABLE_NAME,
			ROUND((data_length + index_length) / 1024 / 1024, 1)  as SizeInMb
			
	FROM 	information_schema.tables 
	
	where 	table_schema = 'MY_DATABASE_NAME'
			and TABLE_TYPE = 'BASE TABLE'
) as tables
        
order by SizeInMb desc