一.获取mysql下所有数据库表的数量 select count(*) tables, table_schema from information_schema.tables group by table_schema; 二.获取指定数据库的表的数量 select count(*) tables, table_schema from information_schema.tables where table_schema = '数据库名' group by table_schema;