mysql—查询数据库表的数量

1、查看数据库表数量
SELECT count(TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_SCHEMA='dbname'; 

2.获取mysql下所有数据库表的数量

SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES GROUP BY table_schema;

3.获取指定数据库的表的数量

SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES 

WHERE table_schema = '数据库名' GROUP BY table_schema;

原文地址:https://www.cnblogs.com/jpfss/p/11544056.html