一、执行下面sql

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

 

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

 

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

 

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

 

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

 

相关文章:

  • 2021-12-14
  • 2022-12-23
  • 2021-12-26
  • 2021-11-27
  • 2021-11-22
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2021-04-09
  • 2021-09-07
  • 2021-10-14
  • 2022-12-23
  • 2021-05-21
  • 2021-09-08
  • 2021-11-30
相关资源
相似解决方案