SUM(data_length+index_length)/1024/1024"SizeinMB"->FROMinformation_schema.TABLESGROUPBYtable_schema;+--------------------+----------------+|Database &"/> SUM(data_length+index_length)/1024/1024"SizeinMB"->FROMinformation_schema.TABLESGROUPBYtable_schema;+--------------------+----------------+|Database &">

首页  >  文章  >  数据库  >  如何查看所有MySQL数据库的大小?

如何查看所有MySQL数据库的大小?

WBOY
WBOY转载
2023-09-17 12:17:09729浏览

如何查看所有MySQL数据库的大小?

我们可以借助以下语句检查所有MySQL数据库的大小

mysql> SELECT table_schema "Database",
-> SUM(data_length + index_length)/1024/1024 "Size in MB"
-> FROM information_schema.TABLES GROUP BY table_schema;

+--------------------+----------------+
| Database           | Size in MB     |
+--------------------+----------------+
| gaurav             | 1.04785156     |
| information_schema | 0.00878906     |
| mysql              | 0.68551350     |
| performance_schema | 0.00000000     |
| sample             | 0.04687500     |
| tutorial           | 0.03125000     |
+--------------------+----------------+

6 rows in set, 1 warning (0.33 sec)

以上是如何查看所有MySQL数据库的大小?的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:tutorialspoint.com。如有侵权,请联系admin@php.cn删除