如何获取MySQL数据库中特定数据库中特定表的大小?
例如,我上传了三张图片,我想要图片表中图片的总大小,大小为KB或MB
答案 0 :(得分:0)
使用以下查询:
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "dbname"
AND table_name = "tablename"