From 9333183e9d46c5003e148e1396f31a0a9b8e9a52 Mon Sep 17 00:00:00 2001 From: whirigoyen Date: Thu, 8 Dec 2022 15:49:58 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20requ=C3=AAte=20pour=20lister=20la=20tai?= =?UTF-8?q?lle=20de=20toutes=20les=20tables=20d'une=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMySQL.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HowtoMySQL.md b/HowtoMySQL.md index 95c4b714..3e1b01b3 100644 --- a/HowtoMySQL.md +++ b/HowtoMySQL.md @@ -807,6 +807,15 @@ GROUP BY table_schema; Pour lister la taille de toutes les tables de toutes les bases : +~~~{.sql} +mysql> SELECT TABLE_NAME AS `Table`, + ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024), 2) AS `Size (MB)` +FROM information_schema.TABLES +WHERE table_schema = "" ORDER BY (data_length + index_length) DESC; +~~~ + +Pour lister la taille de toutes les tables de toutes les bases : + ~~~{.sql} mysql> SELECT table_schema as `Database`,