如何获取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.