Skip to content

Instantly share code, notes, and snippets.

@haoess
Created November 2, 2010 08:52
Show Gist options
  • Save haoess/659383 to your computer and use it in GitHub Desktop.
Save haoess/659383 to your computer and use it in GitHub Desktop.
List out one database, and each tables size in detail
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";
-- thanks to http://www.mkyong.com/mysql/how-to-calculate-the-mysql-database-size/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment