{"id":4715,"date":"2012-04-10T02:10:00","date_gmt":"2012-04-10T02:10:00","guid":{"rendered":""},"modified":"2026-04-18T22:48:41","modified_gmt":"2026-04-18T22:48:41","slug":"check-mysql-database-size-using-sql-query","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=4715","title":{"rendered":"Check MySQL Database Size Using SQL Query"},"content":{"rendered":"<p>Plain and simple<\/p>\n<p><!-- codeblock lang=\"SQL\" line=\"1\" --><\/p>\n<pre><code>\r\nSELECT \r\nCONCAT(sum(ROUND(((DATA_LENGTH + INDEX_LENGTH - DATA_FREE) \/ 1024 \/ 1024),2)),\" MB\") \r\nAS Size \r\nFROM INFORMATION_SCHEMA.TABLES \r\nWHERE TABLE_SCHEMA \r\nLIKE '%YOUR_DB_NAME%' ;\r\n<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n<p>All thanks to <a href=\"http:\/\/www.novell.com\/communities\/node\/8706\/check-mysql-database-size-using-sql-query\">mendesdomnic<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plain and simple SELECT CONCAT(sum(ROUND(((DATA_LENGTH + INDEX_LENGTH &#8211; DATA_FREE) \/ 1024 \/ 1024),2)),&#8221; MB&#8221;) AS Size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA LIKE &#8216;%YOUR_DB_NAME%&#8217; ; All thanks to mendesdomnic<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-4715","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4715"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4715\/revisions"}],"predecessor-version":[{"id":12897,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4715\/revisions\/12897"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}