Check Mysql DB size in MB or GB

To Check the DB size in MB, login to mysql and execute the below query in mysql

mysql> SELECT table_schema “DB Name”,Round(Sum(data_length + index_length) / 1024 / 1024 , 1) “DB Size in MB” FROM information_schema.tables GROUP  BY table_schema;

To Check the DB size in GB, login to mysql and execute below query in mysql

mysql> 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;

Comments are closed.