Last Updated: February 25, 2016
·
930
· adamstrawson

Get size of MySQL database with a query

Getting sizes in MB

SELECT table_schema "Database", sum( data_length + index_length ) / 1024 / 1024 "Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; 

Or for sizes in GB, for those larger Databases

SELECT table_schema "Database", sum( data_length + index_length ) / 1024 / 1024 / 1024 "Size in GB" FROM information_schema.TABLES GROUP BY table_schema ; 

1 Response
Add your response

Thanks! V Handy!

over 1 year ago ·