Computer SoftwareMySQL SQL Command Snippets Updated September 02 2024
See the size of all Databases the user has access to: (MySQL Only?)
Copy to ClipboardSELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;



See the size of all tables in a specific database (change database_name): (MySQL Only?)
Copy to Clipboard SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC;


See the size of all tables in all databases, order by size: (MySQL Only?)
Copy to Clipboard SELECT TABLE_SCHEMA AS `Database`, TABLE_NAME AS `Table`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM information_schema.TABLES ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC;
Search Keywords: Mysql Database Commands




©2024 - Some portions of this website are Copyrighted.
Your IP: 3.147.65.111     Referring URL:
Browser: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Terms and Conditions, Privacy Policy, and Security Policy