Skip to content

Instantly share code, notes, and snippets.

@olivM
Created April 27, 2012 15:50
Show Gist options
  • Save olivM/2510319 to your computer and use it in GitHub Desktop.
Save olivM/2510319 to your computer and use it in GitHub Desktop.
mysql cli : get all tables size
SELECT TABLE_SCHEMA AS 'Database', TABLE_NAME AS 'Table',
CONCAT(ROUND(((DATA_LENGTH INDEX_LENGTH - DATA_FREE) / 1024 / 1024),2)," Mb") AS Size FROM INFORMATION_SCHEMA.TABLES ORDER BY Size ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment