{"id":3389,"date":"2017-03-16T21:03:28","date_gmt":"2017-03-16T21:03:28","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=3389"},"modified":"2017-03-16T21:03:28","modified_gmt":"2017-03-16T21:03:28","slug":"list-sizes-mysql-databases","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2017\/03\/16\/list-sizes-mysql-databases\/","title":{"rendered":"List sizes of MySQL databases"},"content":{"rendered":"<p>Do you wonder which databases are actually taking up how much space but only have one huge ibdata1 in your \/var\/lib\/mysql and the directories inside your mysql data directory don&#8217;t represent the actual database sizes? <\/p>\n<p>Run from a mysql root console:<br \/>\n<\/p>\n<p>mysql> SELECT table_schema AS &#8220;Database name&#8221;, SUM(data_length + index_length) \/ 1024 \/ 1024 AS &#8220;Size (MB)&#8221; FROM information_schema.TABLES GROUP BY table_schema;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| Database name      | Size (MB)   |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| information_schema |  0.00878906 |<br \/>\n| mysql              |  0.62860394 |<br \/>\n| performance_schema |  0.00000000 |<br \/>\n| roundcube          |  0.46875000 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+<br \/>\n8 rows in set (1.21 sec)<br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you wonder which databases are actually taking up how much space but only have one huge ibdata1 in your \/var\/lib\/mysql and the directories inside your mysql data directory don&#8217;t represent the actual database sizes? Run from a mysql root console: mysql> SELECT table_schema AS &#8220;Database name&#8221;, SUM(data_length + index_length) \/ 1024 \/ 1024 AS &#8230; <a title=\"List sizes of MySQL databases\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2017\/03\/16\/list-sizes-mysql-databases\/\" aria-label=\"Read more about List sizes of MySQL databases\">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":[70],"tags":[],"class_list":["post-3389","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/3389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=3389"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/3389\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=3389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=3389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=3389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}