This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script for checking the size of Database and Tables in MySQL.
MySQL: Script to find total occupied Size of each Storage Engines
Find the size of Database:
1 2 3 4 5 |
SELECT table_schema AS Database_Name ,ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS SizeInMB FROM information_schema.tables GROUP BY table_schema |
Find the size of Table:
1 2 3 4 5 6 |
SELECT table_name AS TableName ,ROUND(((data_length + index_length) / 1024 / 1024), 2) AS SizeInMB FROM information_schema.TABLES WHERE table_schema = 'Database_NAME' AND table_name = 'Table_Name' |
Leave a Reply