Skip to content

Instantly share code, notes, and snippets.

@eloipoch
Created June 17, 2013 02:55
Show Gist options
  • Save eloipoch/5794382 to your computer and use it in GitHub Desktop.
Save eloipoch/5794382 to your computer and use it in GitHub Desktop.
Scripts about MySql administration
SELECT table_name AS 'Tables',
ROUND((data_length / 1024 / 1024), 2) "Data in Mb",
ROUND((index_length / 1024 / 1024), 2) "Index in Mb",
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = :database
ORDER BY ROUND(data_length + index_length) DESC;
SELECT table_name AS 'Tables',
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = :database
ORDER BY ROUND(data_length + index_length) DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment