mysql查看库、表占用存储空间大小
http://blog.csdn.net/bzfys/article/details/55252962
1. 查看该数据库实例下所有库大小,得到的结果是以MB为单位
<span class="keylink">mysql</span>> select table_schema,sum(data_length)/1024/1024 as data_length,sum(index_length)/1024/1024 \
as index_length,sum(data_length+index_length)/1024/1024 as sum from information_schema.tables;
2、查看该实例下各个库大小
mysql> select table_schema, sum(data_length+index_length)/1024/1024 as total_mb,
sum(data_length)/1024/1024 as data_mb, sum(index_length)/1024/1024 as index_mb,
count(*) as tables, curdate() as today from information_schema.tables group by table_schema order by 2 desc;
3、查看单个库的大小
mysql> select concat(truncate(sum(data_length)/1024/1024,2),'mb') as data_size,
concat(truncate(sum(max_data_length)/1024/1024,2),'mb') as max_data_size,
concat(truncate(sum(data_free)/1024/1024,2),'mb') as data_free,
concat(truncate(sum(index_length)/1024/1024,2),'mb') as index_size
from information_schema.tables where table_schema = 'schema_name';
4、查看单个表的状态
mysql> show table status from data_1234567890 where name = 'data_1234567890_ss' \G
5、查看单库下所有表的状态
mysql> select table_name, (data_length/1024/1024) as data_mb , (index_length/1024/1024)
as index_mb, ((data_length+index_length)/1024/1024) as all_mb, table_rows
from information_schema.tables where table_schema = 'schema_name';
mysql查看库、表占用存储空间大小的更多相关文章
- Mysql——查看数据库,表占用磁盘大小
.查询所有数据库占用磁盘空间大小 select TABLE_SCHEMA, concat(,),' MB') as data_size, concat(,),'MB') as index_size f ...
- MySQL查看库表的大小
MySQL数据库空间使用情况查询 如果想知道MySQL数据库中每个表占用的空间.表记录的行数的话,可以打开MySQL的 information_schema 数据库.在该库中有一个 TABLES 表, ...
- hbase数据导出和恢复 设置双master + 查看hbase表占用磁盘大小
1.备份TETST111hbase org.apache.hadoop.hbase.mapreduce.Export TEST111 /do1/hh2.drop 掉test111表 -- 只能dro ...
- MySQL查看数据库表容量大小
本文介绍MySQL查看数据库表容量大小的命令语句,提供完整查询语句及实例,方便大家学习使用. 1.查看所有数据库容量大小 select table_schema as '数据库', sum(table ...
- mysql查看某个表的列名
mysql查看某个表的列名mysql -uusername -p 输入密码按登录mysqlshow databases; 查看有哪些数据库use dbname; 选择数据库show tables:查看 ...
- SQL 查看数据库表的容量大小
--==============查看数据库表的容量大小========start================================?============ Create Table # ...
- MYSQL查看数据表最后更新时间
MYSQL查看数据表最后更新时间 - 拨云见日 - CSDN博客 https://blog.csdn.net/warnerwu/article/details/73352774 mysql> S ...
- MySQL统计库表大小
统计每个库每个表的大小是数据治理的其中最简单的一个要求,本文将从抽样统计结果及精确统计结果两方面来统计MySQL的每个库每个表的数据量情况. 1.统计预估数据量 mysql数据字典库informati ...
- 查看MYSQL中数据表占用的空间
由于数据太大了.所以MYSQL需要瘦身,那前提就是需要知道每个表占用的空间大小. 首先打开指定的数据库: use information_schema; 如果想看指定数据库中的数据表,可以用如下语句: ...
随机推荐
- C++模板函数实践1
实践如下: #include <iostream> #include <typeinfo> using namespace std; class Bean{ private: ...
- Firefox63以后 禁止自动更新方式
参考:https://bbs.kafan.cn/thread-2135160-1-1.html 63版以后在prefs.js文件末尾加代码来禁止自动更新的方式失效 新方式: 使用DisableAppU ...
- leetcode 139 单词拆分(word break)
一开始的错误答案与错误思路,幻想直接遍历得出答案: class Solution { public: bool wordBreak(string s, vector<string>& ...
- [flask]jinjia2处理表单-实现搜索界面
思路: 通过flask-wtf创建forms表单类 在app.py中创建search_name()视图函数,实例化form表单类,将通过render_template将form传给html模板 创建h ...
- iOS 图表工具charts之BarChartView
关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...
- PyQt GUI--信号与槽
目录 目录 前言 系统软件 GUI的主循环 信号与槽 信号的应用 使用控件类的内建信号 自定义信号 带参数的信号 槽的应用 创建槽 信号和槽的连接 最后 前言 PyQt中的信号和槽,就是一个触发和执行 ...
- windows触摸板速度调整
Windows 触摸板滚动速度调整: 在注册表中: The magic key is: Computer\HKEY_CURRENT_USER\Software\Microsoft\Wisp\Tou ...
- Python 的 Collection 库
Collections 是 Python 内建的一个集合模块,提供了许多额外的数据类型. namedtuple namedtuple 主要用来生成可以使用名称来访问元素的数据对象,通常用来增强代码的可 ...
- jenkins提示反向代理设置有误
jenkins提示反向代理设置有误 参照地址 https://www.cnblogs.com/yhleng/p/7594892.html 分析:是junkins的url地址填错了 解决: 系统管理-- ...
- DocX 在文档中插入图片时,为什么不能按实际设置的大小插入,而Spire.Doc却可以
我的目标目标要求:将一个图片插入到页面中,页面边界为0,使用下面的代码去实现(button1UseDocX_Click函数),生成的文档不能达到目的.而使用Spire.Doc却能达到目的button1 ...