如何获取mysql数据库的大小? [英] How to get size of mysql database?
本文介绍了如何获取mysql数据库的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获取mysql数据库的大小?
假设目标数据库名为v3。
How to get size of a mysql database?
Suppose the target database is called "v3".
推荐答案
运行此查询,您可能会得到您要查找的内容:
Run this query and you'll probably get what you're looking for:
SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
此查询来自 mysql论坛,其中有更全面的说明。
This query comes from the mysql forums, where there are more comprehensive instructions available.
这篇关于如何获取mysql数据库的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文