mysql统计库下所有表数据行数

一、执行下面sql

select concat(
'select "',
TABLE_name,
'", count(*) from ',
TABLE_SCHEMA,
'.',
TABLE_name,
' union all'
) from information_schema.tables
where TABLE_SCHEMA='test';

 

二、执行上面sql后会批量生成sql

 

 

三、把生成的sql拷出来,并去掉最后的一个“union all”:

 

 

posted @ 2018-11-30 12:26  &阿岩  Views(3394)  Comments(1Edit  收藏  举报