-- 统计各库的表数量:是否有漏表
MySQL [information_schema]> select TABLE_SCHEMA ,count(1) from tables group by TABLE_SCHEMA ;
+--------------------+----------+
| TABLE_SCHEMA | count(1) |
+--------------------+----------+
| test2 | 16 |
| test1 | 145 |
-- 统计各表的数据条数:是否有数据
MySQL [information_schema]> select TABLE_SCHEMA, table_name,table_rows from information_schema.tables where TABLE_SCHEMA in ('test1','test2') order by table_rows desc;
+--------------+------------------------------+------------+
| TABLE_SCHEMA | table_name | table_rows |
+--------------+------------------------------+------------+
| test1 | alertlog | 110115 |
| test2 | tbl_task | 8713 |
| test1 | appsearc | 2280 |