select sum(table_rows) from information_schema.tables as a where a.table_schema="sakila" and a.table_type = "base table";

注意:sakila为数据库名,准确的是数据结构。