Finding MySQL Database Size

Posted on by By Nikhilesh, in Business Intelligence, Databases | 0

Finding MySQL Database Size

Here’s the SQL script to list out the entire databases size.

SELECT table_schema "Data Base Name",
SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES
GROUP BY table_schema;
SELECT TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "schema_name";

Following is the calculation:

data_length + index_length = total table size.

data_length = store the real data.
index_length = store the table index.

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments