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 ;
Written by adamstrawson
Related protips
1 Response

Thanks! V Handy!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#