0
0 answers 10,557 views 6 years ago

How to Get the Size of all Tables in a database in MySQL?

MySQL Query for getting list of tables in a database with size.




SELECT

    table_name 'Table Name',

    data_length + index_length 'Size in Bytes',

    ROUND(((data_length + index_length) / 1024 / 1024), 2) 'Size in MiB'

FROM information_schema.tables

WHERE table_schema = 'your_database_name'

ORDER BY (data_length + index_length) DESC;


Share:
S
Student User
Asked 6 years ago

0 Answer(s)

No answers yet

Be the first to help by answering this question!

Login to Answer

Login Required

Please login to submit an answer.

Community pulse
  • Total questions216
  • Answers posted19
  • Accepted answers0
  • Active learners11

Need personalised help?

Start a new discussion and get answers from verified teachers & toppers.

Ask now