<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Mariadb on tech.notes</title>
    <link>https://newblog.utzer.de/tags/mariadb/</link>
    <description>Recent content in Mariadb on tech.notes</description>
    <generator>Hugo</generator>
    <language>de</language>
    <lastBuildDate>Wed, 02 Oct 2019 19:31:42 +0000</lastBuildDate>
    <atom:link href="https://newblog.utzer.de/tags/mariadb/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Size of each table in a database of MySQL or MariaDB</title>
      <link>https://newblog.utzer.de/2019/10/02/size-of-each-table-in-a-database-of-mysql-or-mariadb/</link>
      <pubDate>Wed, 02 Oct 2019 19:31:42 +0000</pubDate>
       <guid isPermaLink="false">http://tech.utzer.de/?p=90</guid> 
      <description>&lt;p&gt;I found something pretty useful, just a quick #MySQL / #MariaDB code snippet to show the size of each table of the currently selected database.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;SELECT table_name ,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  round(((data_length + index_length) / 1024 / 1024), 2) as SIZE_MB
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;FROM information_schema.TABLES
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;WHERE table_schema = DATABASE() ORDER BY SIZE_MB DESC;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You have to start &amp;lsquo;mysql&amp;rsquo; from CLI, in any terminal emulator of you choice, by adding the database name it should select when started, so lets say the database you&amp;rsquo;re looking to get the table sizes from is &amp;lsquo;wordpress&amp;rsquo; you&amp;rsquo;d have to call &amp;lsquo;mysql wordpress&amp;rsquo; and then in mysql you&amp;rsquo;d have to enter the whole code snippet from above and hit enter afterwards.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
