1.查询指定数据库表的大小

SELECT concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data FROM information_schema.TABLES  where TABLE_SCHEMA='你的数据库名称' and table_name = '表名';

2.查询指定数据库中表数量

SELECT COUNT(*) TABLES FROM information_schema.TABLES  WHERE table_schema ='你的数据库名称' GROUP BY table_schema;

3.查询指定数据库中表条数

select table_name,table_rows from `information_schema`.`tables` where TABLE_SCHEMA = '你的数据库名称' and TABLE_NAME like '表名'

4.查询数据库数量

SELECT count(DISTINCT(table_schema))  FROM information_schema.TABLES

 

 mysql 统计数据库基本资源sql

 

相关文章:

  • 2021-04-09
  • 2021-09-10
  • 2021-11-02
  • 2021-12-24
  • 2021-10-05
  • 2021-11-22
  • 2021-11-13
猜你喜欢
  • 2021-04-25
  • 2021-12-26
  • 2021-12-04
  • 2021-07-19
  • 2021-11-26
  • 2022-12-23
  • 2021-06-30
相关资源
相似解决方案