第一步:首先打开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都有一个库information_schema,里面有一张表TABLES存储了所有数据库表的信息,因此,可以从这张表中查看数据库大小和表大小 查询数据库大小 ,),'GB') as data from information_schema.tables where table_schema='esb'; 查询数据库中表大小 ,),'GB') as data from information_schema.tables where table_schema='esb' and tab…
一.查询所有数据库占用空间大小 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 d…
查询数据库中所有表名select table_name from information_schema.tables where table_schema='csdb' and table_type='base table'; 查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='csdb' and table_name='users'…
查询数据库的占用 SELECT CONCAT(ROUND(SUM(index_length)/(1024*1024), 2), ' MB') AS 'Total Index Size' , CONCAT(ROUND(SUM(data_length)/(1024*1024), 2), ' MB') AS 'Total Data Size' FROM information_schema.TABLES where table_schema like 'edb_a%' ; 查询表的占用 SELECT…