每个表行数
SELECT
table_name AS `Table`,
table_rows AS `Rows`
FROM
information_schema.TABLES
WHERE
table_schema = '数据库名';
每个表大小
SELECT
table_name AS `Table`,
ROUND((data_length + index_length) / 1024 / 1024, 2) AS `Size in MB`
FROM
information_schema.TABLES
WHERE
table_schema = '数据库名';
数据库总行数
SELECT SUM(table_rows) AS `Total Rows`
FROM information_schema.TABLES
WHERE table_schema = '数据库名';
数据库总大小
SELECT
SUM(data_length + index_length) AS `Total Size in Bytes`,
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS `Total Size in MB`
FROM information_schema.TABLES
WHERE table_schema = '数据库名';