MySQL taille des tables

Affichage de la taille des bases de donnée

Taille en Mo

SELECT
 table_schema AS "Nom de la base", 
 ROUND(SUM( data_length + index_length ) / 1024 / 1024, 2) AS "Taille en Mo" 
 FROM information_schema.TABLES
 GROUP BY TABLE_SCHEMA;
Exemple de rendu :
+--------------------+--------------+
| Nom de la base     | Taille en Mo |
+--------------------+--------------+
| information_schema |         0.17 |
| mysql              |         0.65 |
| performance_schema |         0.00 |
+--------------------+--------------+
3 rows in set (0.01 sec)

Taille en Go

SELECT
 table_schema AS "Nom de la base", 
 ROUND(SUM( data_length + index_length ) / 1024 / 1024 /1024 , 2) AS "Taille en Go" 
 FROM information_schema.TABLES
 GROUP BY TABLE_SCHEMA;