.查询所有数据库占用磁盘空间大小 select TABLE_SCHEMA, concat(,),' MB') as data_size, concat(,),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA ORDER BY data_size desc; .查询单个库中所有表磁盘占用大小 select TABLE_NAME, concat(,),' MB') as data_size, concat…
本文介绍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…
1.查看数据库表数量SELECT count(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_SCHEMA='dbname'; select count(*) tables ,table_schema from information_schema.tables where table_schema='work_ad' group by table_schema;…
查看数据库表基本信息. select * from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = '数据库名' and information_schema.TABLES.TABLE_NAME = '表名'; 查看mysql数据库大小 SELECT sum(DATA_LENGTH)+sum(INDEX_LENGTH) FROM information_schema.TABLES where TAB…
1.查看数据库表数量SELECT count(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_SCHEMA='dbname'; 2.获取mysql下所有数据库表的数量 SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES GROUP BY table_schema; 3.获取指定数据库的表的数量 SELECT COUNT(*) TABLES, tabl…