diff --git a/HowtoMySQL/Troubleshooting.md b/HowtoMySQL/Troubleshooting.md index 65d5a860..1fc643d3 100644 --- a/HowtoMySQL/Troubleshooting.md +++ b/HowtoMySQL/Troubleshooting.md @@ -544,3 +544,24 @@ Enfin supprimer l'utilisateur root : ~~~ MariaDB [(none)]> DELETE FROM mysql.user where User='root'; ~~~ + +## ConnaƮtre la taille des bases + +~~~ +$ mysql mysql +mysql> SELECT table_schema AS "Database Name", +ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size in (MB)" +FROM information_schema.TABLES +GROUP BY table_schema; +~~~ + +## ConnaƮtre la taille des tables d'une base + +~~~ +$ mysql mysql +mysql> SELECT table_name AS "Table Name", +ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size in (MB)" +FROM information_schema.TABLES +WHERE table_schema = "" +ORDER BY (data_length + index_length) DESC; +~~~ \ No newline at end of file