If you want to count all databases and resumes, try the following:
SELECT IFNULL(table_schema,'Total') "Database",TableCount FROM (SELECT COUNT(1) TableCount,table_schema FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','mysql') GROUP BY table_schema WITH ROLLUP) A;
Here is an example run:
mysql> SELECT IFNULL(table_schema,'Total') "Database",TableCount -> FROM (SELECT COUNT(1) TableCount,table_schema -> FROM information_schema.tables -> WHERE table_schema NOT IN ('information_schema','mysql') -> GROUP BY table_schema WITH ROLLUP) A; +--------------------+------------+ | Database | TableCount | +--------------------+------------+ | performance_schema | 17 | | Total | 17 | +--------------------+------------+ 2 rows in set (0.29 sec)
Give it a try !!!
RolandoMySQLDBA Mar 05 2018-11-11T00: 00Z
source share