Created
February 20, 2018 09:44
-
-
Save fnkr/aa7691ed0274792f36f659205ccc58c5 to your computer and use it in GitHub Desktop.
Human readable overview of MySQL/MariaDB database size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema "Database", | |
Round(Sum(data_length) / 1024 / 1024, 0) "Data size (in MB)", | |
Round(Sum(data_length) / 1024 / 1024 / 1024, 3) "Data size (in GB)", | |
Round(Sum(index_length) / 1024 / 1024, 0) "Index size (in MB)", | |
Round(Sum(index_length) / 1024 / 1024 / 1024, 3) "Index size (in GB)", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 0) "Total size (in MB)", | |
Round(Sum(data_length + index_length) / 1024 / 1024 / 1024, 3) "Total 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