是否可以使用单个命令显示给定数据库中每个表的行数?
使用information_schema:
select table_schema database, table_name, table_rows rowcount from information_schema.tables where table_schema = 'DATABASE_TO_LOOK_UP' and engine = 'MYISAM';
Afaik仅用于MyISAM表,一个确切的rowcount存储在information_schema表中。 如果你使用INNODB表的上面的SQL,显示的rowcount将是一个近似值。