MySQL数据库表空间大小查询SQL技术
使用命令查看 MySQL 的各种信息,大都数都在 information_schema 表里面。
SELECT CONCAT(ROUND(SUM(data_length/1024/1024),2), 'MB') as data_length, CONCAT(ROUND(SUM(index_length/1024/1024),2), 'MB') as index_length FROM information_schema.tables WHERE table_schema = 'lmlphp' AND table_name = 'lmlphp_table';
下面的更实用
SELECT table_name, CONCAT(ROUND(SUM(data_length/1024/1024),2), 'MB') as data_length, CONCAT(ROUND(SUM(index_length/1024/1024),2), 'MB') as index_length FROM information_schema.tables WHERE table_schema = 'lmlphp' GROUP BY table_name ORDER BY data_length DESC;
相关文章
暂无