• ADADADADAD

    mysql查询数据库大小的方法[ mysql数据库 ]

    mysql数据库 时间:2024-12-03 10:27:52

    作者:文/会员上传

    简介:

    mysql查询数据库的大小的方法:1、查询整个库的大小,代码为【select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')】;2、查询某个库的大小,代码为【from informati

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    mysql查询数据库的大小的方法:1、查询整个库的大小,代码为【select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')】;2、查询某个库的大小,代码为【from informati】。

    mysql查询数据库的大小的方法:

    1、查询整个mysql数据库,整个库的大小;单位转换为MB。

    select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as datafrom information_schema.TABLES

    2、查询mysql数据库,某个库的大小;

    select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb'

    3、查看库中某个表的大小;

    select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name = 'test_a';

    4、查看mysql库中,test开头的表,所有存储大小;

    select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name like 'test%';
    mysql查询数据库大小的方法.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysql