首页 > 数据库技术 > 详细

mysql 查询数据库大小

时间:2021-08-14 16:58:34      阅读:29      评论:0      收藏:0      [点我收藏+]

查询数据库大小

SELECT CONCAT(TRUNCATE(SUM(data_length)/1024/1024,2),‘MB‘) AS data_size,
       CONCAT(TRUNCATE(SUM(max_data_length)/1024/1024,2),‘MB‘) AS max_data_size,
       CONCAT(TRUNCATE(SUM(data_free)/1024/1024,2),‘MB‘) AS data_free,
       CONCAT(TRUNCATE(SUM(index_length)/1024/1024,2),‘MB‘) AS index_size
FROM information_schema.tables WHERE TABLE_SCHEMA = ‘数据库名‘;

查询数据库表大小

SELECT CONCAT(TRUNCATE(SUM(data_length)/1024/1024,2),‘MB‘) AS data_size,
       CONCAT(TRUNCATE(SUM(max_data_length)/1024/1024,2),‘MB‘) AS max_data_size,
       CONCAT(TRUNCATE(SUM(data_free)/1024/1024,2),‘MB‘) AS data_free,
       CONCAT(TRUNCATE(SUM(index_length)/1024/1024,2),‘MB‘) AS index_size
FROM information_schema.tables WHERE TABLE_NAME = ‘数据库表名‘;

mysql 查询数据库大小

原文:https://www.cnblogs.com/farpig/p/15141014.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!