MySQL 查询数据库表的数量
1.获取指定数据库的表的数量
SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES GROUP BY table_schema;
2.获取mysql下所有数据库表的数量
SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES
WHERE table_schema = '数据库名' GROUP BY table_schema;
查询当前库所有表数据量
SELECT
TABLE_NAME,TABLE_ROWS
FROM
information_schema.`TABLES`
WHERE
TABLE_SCHEMA = (
SELECT
database
())
ORDER
BY
TABLE_ROWS
DESC
;
REF
https://baijiahao.baidu.com/s?id=1605681796772603432&wfr=spider&for=pc
标签:TABLES,TABLE,查询数据库,MySQL,table,数量,SELECT,schema From: https://www.cnblogs.com/emanlee/p/17419940.html