edoceo

MySQL Tips and Tricks

MySQL Query to Show Database Size

SELECT table_schema "Data Base Name",
    sum( data_length + index_length ) / 1024 / 1024 "Used MB"
FROM information_schema.TABLES
GROUP BY table_schema ;

MySQL Query to Show Free Space

SELECT table_schema "Data Base Name",
    sum( data_length + index_length ) / 1024 / 1024 "Used MB",
    sum( data_free ) / 1024 / 1024 "Free MB"
FROM information_schema.TABLES
GROUP BY table_schema ;

Loading Comments from Disqus...