1、查询各个数据库大小
-- 查询mysql各个数据库大小 SELECT table_schema, round( sum(data_length / 1024 / 1024), 2 ) AS size, 'MB' as '单位' FROM information_schema. TABLES GROUP BY table_schema ORDER BY size DESC;
效果
2、指定数据库表行数
-- 查询mysql指定数据库表行数 SELECT table_name, table_rows FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'your_db_name' ORDER BY table_rows DESC;
效果
3、各个数据库表行数
-- 查询mysql所有数据库中表行数 SELECT table_schema, table_name, table_rows FROM information_schema. TABLES ORDER BY table_schema, table_rows DESC;
效果