Query to select size of each of DB in MY SQL server

SELECT table_schema as “Name Of Database”,
sum( data_length + index_length )/1024/1024 as “Size of Data Base in MB”
FROM information_schema.TABLES GROUP BY table_schema ;

This will return size of EACH database on the SQL server. If there are 5 Databases, it will return 5 rows having two columns, first column as name of the DB and second column as its size.

About ChandanPandey

Try to come up with a good design as by product of good coding practices

Posted on June 1, 2012, in MY SQL and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: