Skip to content

Instantly share code, notes, and snippets.

@AykutCevik
Created September 20, 2017 08:28
Show Gist options
  • Save AykutCevik/dc6cc1aa1518a488d9358ce0f47b2d62 to your computer and use it in GitHub Desktop.
Save AykutCevik/dc6cc1aa1518a488d9358ce0f47b2d62 to your computer and use it in GitHub Desktop.
List MySQL databases with sizes
SELECT table_schema "database",
floor( sum( data_length + index_length ) / 1024 / 1024) "Data Base Size in MB",
floor(sum( data_free )/ 1024 / 1024 ) "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment