SELECT table_schema “dbName”,
sum( data_length + index_length ) / 1024 / 1024 “Data Base Size in MB”,
sum( data_free )/ 1024 / 1024 “Free Space in MB”
FROM information_schema.TABLES
GROUP BY table_schema ;
To Get Size in GB:
SELECT sum(round(((data_length + index_length) / 1024 / 1024 / 1024), 2)) as “Size in GB” FROM information_schema.TABLES WHERE table_schema = “dbName”
Found on Stackoverflow.