查询MySQL中某个数据库中有多少张表
查询SQL语句:
SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES WHERE table_schema = '数据库' GROUP BY table_schema;
例如:
mysql -uroot -p123456 -e "SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES WHERE table_schema = 'bertram' GROUP BY table_schema;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------+--------------+
| TABLES | table_schema |
+--------+--------------+
| 296 | bertram |
+--------+--------------+