Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: matias s..
Added: Jan 31, 2019 4:27 PM
Modified: Jan 31, 2019 4:30 PM
Views: 25
Tags: mysql
Show tables size for certain DB in MB.
  1. SELECT
  2.    TABLE_NAME AS `Table`,
  3.    round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
  4. FROM information_schema.TABLES
  5. WHERE table_schema = "$DB_NAME"
  6.    AND TABLE_NAME = "$TABLE_NAME";
Comments disabled