至尊宝的传说
SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND( (data_length + index_length) /1024, 2 ) AS "Total Size Kb"FROM information_schema.TABLESWHERE information_schema.TABLES.table_schema = 'YOUR SCHEMA NAME/DATABASE NAME HERE'LIMIT 0 , 30您可以从“ information_schema ” - > SCHEMATA表 - >“ SCHEMA_NAME ”列中获取模式名称附加 您可以获得如下的mysql数据库大小。SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema; 结果DB Name | DB Size in MBmydatabase_wrdp 39.1information_schema 0.0