How to get the size of all databases in mysql

To get the size of all databases in mysql you can use the following query.

Sample MySql

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

One thought on “How to get the size of all databases in mysql

Leave a Reply