• ADADADADAD

    怎么查看MySQL数据库大小[ mysql数据库 ]

    mysql数据库 时间:2024-11-28 13:24:19

    作者:文/会员上传

    简介:

    进入information_schema 数据库(存放了其他的数据库的信息)mysql> use information_schemaReading table information for completion of table and column namesYou can turn

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

    进入information_schema 数据库(存放了其他的数据库的信息)
    mysql> use information_schema
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed

    第一种情况:查询所有数据库的总大小,方法如下:
    mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES;
    +-----------+
    | data |
    +-----------+
    | 3052.76MB |
    +-----------+
    1 row in set (0.02 sec)


    第二种情况:查看指定数据库的大小,比如说:数据库test,方法如下:
    mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='test';
    +----------+
    | data |
    +----------+
    | 142.84MB |
    +----------+
    1 row in set (0.00 sec)


    第三种:查看指定数据库的表的大小,比如说:数据库test中f_apply表,方法如下:
    mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='ixinnuo_financial' and table_name='f_apply';
    +--------+
    | data|
    +--------+
    | 0.08MB |
    +--------+
    1 row in set (0.00 sec)

    怎么查看MySQL数据库大小.docx

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

    推荐度:

    下载
    热门标签: mysql数据库