Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Monday, February 10, 2014

MySQL: Query to calculate database size.

So Guys, how do you calculate the size of your databases on db server using a simple & single query..
.
.
.
Well this thing is easily achievable by a simple query. For this you need to query information_schema, which will result you the database size and other information.

   SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024 / 1024, 1) "DB Size in GB" 
   FROM   information_schema.tables GROUP  BY table_schema;

:)

No comments:

Post a Comment