SELECT
table_schema AS 'Db Name',
Round( Sum( data_length + index_length ) / 1024 / 1024, 3 ) AS 'Db Size (MB)',
Round( Sum( data_free ) / 1024 / 1024, 3 ) AS 'Free Space (MB)'
FROM information_schema.tables GROUP BY table_schema ;
查询数据库大小
本文介绍如何使用SQL查询语句获取数据库的大小及可用空间,包括数据库名称、总大小(MB)、剩余空间(MB),通过GROUP BY操作按数据库进行分组。

被折叠的 条评论
为什么被折叠?



