{"id":264,"date":"2017-12-01T09:13:12","date_gmt":"2017-11-30T23:13:12","guid":{"rendered":"http:\/\/www.mrmarkyoung.com\/oracle\/?p=264"},"modified":"2018-06-04T15:26:46","modified_gmt":"2018-06-04T05:26:46","slug":"calculate-mysql-size","status":"publish","type":"post","link":"http:\/\/www.mrmarkyoung.com\/oracle\/2017\/12\/01\/calculate-mysql-size\/","title":{"rendered":"Calculate MySQL Size"},"content":{"rendered":"<p>How to calculate the table and database size in MySQL<\/p>\n<pre class=\"lang:default decode:true \" >SELECT table_schema \"Data Base Name\", sum( data_length + index_length) \/ 1024 \/ 1024\r\n\"Data Base Size in MB\" FROM information_schema.TABLES GROUP BY table_schema ;<\/pre>\n<p>and<\/p>\n<pre class=\"lang:default decode:true \" >SELECT table_name, table_rows, data_length, index_length,\r\nround(((data_length + index_length) \/ 1024 \/ 1024),2) \"Size in MB\"\r\nFROM information_schema.TABLES where table_schema = \"&lt;schema&gt;\"; <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to calculate the table and database size in MySQL SELECT table_schema &#8220;Data Base Name&#8221;, sum( data_length + index_length) \/ 1024 \/ 1024 &#8220;Data Base Size in MB&#8221; FROM information_schema.TABLES GROUP BY table_schema ; and SELECT table_name, table_rows, data_length, index_length, round(((data_length + index_length) \/ 1024 \/ 1024),2) &#8220;Size in MB&#8221; FROM information_schema.TABLES where table_schema = &#8230; <a title=\"Calculate MySQL Size\" class=\"read-more\" href=\"http:\/\/www.mrmarkyoung.com\/oracle\/2017\/12\/01\/calculate-mysql-size\/\" aria-label=\"Read more about Calculate MySQL Size\">Read more<\/a><\/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-264","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":1,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":265,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/posts\/264\/revisions\/265"}],"wp:attachment":[{"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mrmarkyoung.com\/oracle\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}