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指定数据库(menjindbtest)表行数
SELECT
table_name,
table_rows
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'menjindbtest'
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;