查看MySQL数据库大小
SELECT CONCAT(round((sum(DATA_LENGTH)+sum(INDEX_LENGTH))/1024/1024, 2), 'MB') AS '占用空间' FROM information_schema.TABLES where TABLE_SCHEMA='kold';
查看MySQL表数据大小
SELECT CONCAT(round((sum(DATA_LENGTH)+sum(INDEX_LENGTH))/1024/1024, 2), 'MB') AS '占用空间' FROM information_schema.TABLES where TABLE_SCHEMA='kold' AND TABLE_NAME='test';