1.查询某个数据库下有多少张表
SELECT COUNT(*) TABLES FROM information_schema.TABLES WHERE table_schema = ‘替换成你的数据库名‘;
2.查询某个数据库下每个表有多少条数据
select TABLE_NAME, concat(truncate(data_length/1024/1024,2),‘ MB‘) as data_size,table_rows from information_schema.tables where TABLE_SCHEMA = ‘替换成你的数据库名‘;
原文地址:https://www.cnblogs.com/linliquan/p/12096807.html
时间: 2024-10-11 00:35:26