How to get MySQL Database Size
SELECT
table_schema "Database Name", Round(Sum(data_length + index_length) / 1024 /
1024, 3) "Database Size in MB" FROM information_schema.tables GROUP BY
table_schema;
Once this query is executed you can view the database size in formation like this::
mysql> SELECT table_schema "Database Name", Round(Sum(data_length + index_length) / 1024 / 1024, 3) "Database Size in MB" FROM information_schema.tables GROUP BY table_schema;
+--------------------+---------------------+
| Database Name | Database Size in MB |
+--------------------+---------------------+
| db11 | 1.834 |
| db12 | 1.834 |
+--------------------+---------------------+
2 rows in set (1.30 sec)
Comments