Skip to content

Instantly share code, notes, and snippets.

@pstoute
Created September 29, 2023 18:28
Show Gist options
  • Save pstoute/6761360c691b78be71bf81f46584d600 to your computer and use it in GitHub Desktop.
Save pstoute/6761360c691b78be71bf81f46584d600 to your computer and use it in GitHub Desktop.
How to get the size of each database in your MySQL install in GB
SELECT table_schema "DB Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024 / 1024, 1) "DB Size in GB"
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