1、查询当前数据库有多少表
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '你的数据库';
2、查询当前数据库占用磁盘
SELECT
SUM(data_length + index_length) / 1024 / 1024 AS total_mb,
SUM(data_length) / 1024 / 1024 AS data_mb,
SUM(index_length) / 1024 / 1024 AS index_mb
FROM
information_schema.tables;