Posts Tagged ‘mysql database size calculate’

postheadericon Calculate the size of a MySQL database

Here present a simple query that could be particularly useful for those who have hosting with limited space for storing data, it is a question of fact by which you can obtain the size of a MySQL database. The information will be available directly from the database managers are therefore extremely reliable.

But we go straight to the code of our query, as it is easy to note, is based on creating an alias to associate the result of calculation:

<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">SELECT COUNT(table_name) AS numero_tabelle,</span> SELECT COUNT (table_name) AS numero_tabelle,</span>

<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">SUM(data_length+index_length) AS dimensione_db</span> SUM (+ data_length index_length) AS dimensione_db</span>
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">FROM INFORMATION_SCHEMA.TABLES</span> FROM INFORMATION_SCHEMA.TABLES</span>

<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left;">WHERE table_schema = 'database'</span> WHERE TABLE_SCHEMA = 'database'</span> Read the rest of this entry »