如何获取mysql数据库的大小? [英] How to get size of mysql database?

查看:29
本文介绍了如何获取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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆