Created
August 29, 2016 20:45
-
-
Save forestbaker/55cd30891bfcdc9278317fa3d50a283e to your computer and use it in GitHub Desktop.
Useful MySQL Queries
This file contains hidden or 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
# Display Storage Space used by Tables in a MySQL Database called "DiagDomain": | |
SELECT table_name AS "Tables", round(((data_length + index_length)/1024/1024/1024), 2) "Size in GB" FROM information_schema.TABLES WHERE table_schema = "DiagDomain" ORDER BY (data_length + index_length) DESC; | |
# Display Storage Space used by all MySQL Databases: | |
SELECT table_schema "database", sum(data_length + index_length)/1024/1024/1024 "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