techfolks mysql tutorials
db size query Mysql Mysql database query query to get db size

How to Get Size of a Database in Mysql


To Get Data Base Size in MB  and Free Space in MB
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.