转自:http://xiaosu.blog.51cto.com/2914416/687835 1.查看数据库的大小 use 数据库名SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH)FROM information_schema.TABLES where TABLE_SCHEMA='数据库名';得到的结果是以字节为单位,除1024为K,除1048576为M. 2.查看表的最后mysql修改时间 select TABLE_NAME,UPDATE_TIME from
#查看每个数据库所占磁盘大小 SELECT TABLE_SCHEMA AS "库名", , ) AS "表所占空间(MB)", , ) AS "索引所占空间(MB)", ,) AS "空间累计(MB)" FROM information_schema.`TABLES` GROUP BY `TABLE_SCHEMA`; #查看某个数据库各表所占磁盘大小 SELECT TABLE_NAME, , ) AS "DATA_
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下: select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下 1 2 3 4 5 select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA orde
查询所有数据库占用磁盘空间大小的SQL语句: 语句如下 select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data_
要想知道每个数据库的大小的话,步骤如下: 1.进入information_schema 数据库(存放了数据库的信息) use information_schema; 2.查询所有数据库的大小: select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables; 3.查看指定数据库的大小: 比如查看数据库home的大小 select concat(round(sum(data_length/1024/1024),
要想知道每个数据库的大小的话,步骤如下: 1.进入information_schema 数据库(存放了其他的数据库的信息) use information_schema; 2.查询所有数据的大小: select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables; 3.查看指定数据库的大小: 比如查看数据库home的大小 select concat(round(sum(data_length/1024/1024
第一步:首先打开Mysql命令行,通过开始菜单-程序-MySql-Command line client,如图1-1所示: 图1-1 第二步:在命令中输入use information_schema 如图1-2所示: 图1-2 第三步:查看指定数据库的大小,输入如下语句: select concat(round(sum(DATA_LENGTH/1024/1024),2), 'MB') as data from TABLES where table_schema= 'offlineCollect
本文介绍MySQL查看数据库表容量大小的命令语句,提供完整查询语句及实例,方便大家学习使用. 1.查看所有数据库容量大小 select table_schema as '数据库', sum(table_rows) as '记录数', , )) as '数据容量(MB)', , )) as '索引容量(MB)' from information_schema.tables group by table_schema order by sum(data_length) desc, sum(index