From e7e5cd9bdda6ae19e272749bc5dda25fc65ed734 Mon Sep 17 00:00:00 2001 From: bserie Date: Mon, 8 Jan 2018 11:43:47 +0100 Subject: [PATCH] =?UTF-8?q?Conna=C3=AEtre=20la=20taille=20des=20bases=20+?= =?UTF-8?q?=20Conna=C3=AEtre=20la=20taille=20des=20tables=20d'une=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMySQL/Troubleshooting.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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