数据库尺寸

  • 如何查询MySQL数据库及其表的尺寸大小?

    要查看MySQL数据库和表的大小,可以使用以下SQL查询语句:,,“sql,查看数据库大小,SELECT table_schema AS ‘数据库名’, SUM(data_length + index_length) / 1024 / 1024 AS ‘大小(MB)’ FROM information_schema.tables GROUP BY table_schema;,,查看表大小,SELECT table_name AS ‘表名’, table_rows AS ‘记录数’, data_length / 1024 / 1024 AS ‘数据大小(MB)’, index_length / 1024 / 1024 AS ‘索引大小(MB)’ FROM information_schema.tables WHERE table_schema = ‘数据库名’ AND table_name = ‘表名’;,`,,将上述代码中的数据库名和表名`替换为实际的数据库和表名即可。

    2024-08-19
    006

联系我们

QQ-14239236

在线咨询: QQ交谈

邮件:asy@cxas.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信