Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Created November 27, 2024 22:34
Show Gist options
  • Save Justintime50/648f45befdeab4ef3c78b11363cc5020 to your computer and use it in GitHub Desktop.
Save Justintime50/648f45befdeab4ef3c78b11363cc5020 to your computer and use it in GitHub Desktop.
Check the size of your database
SELECT
table_name AS `Table`,
table_rows AS `Records`,
ROUND((data_length + index_length) / 1024 / 1024, 2) AS `Size (MB)`
FROM
information_schema.tables
WHERE
table_schema = 'your_db_table'
ORDER BY
`Size (MB)` DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment