MySQL查看数据库各表暂用多少G空间

查看一个库中各表的情况

SELECT CONCAT(table_schema,’.’,table_name) AS ‘Table Name’, CONCAT(ROUND(table_rows/1000000,4),‘M’) AS ‘Number of Rows’, CONCAT(ROUND(data_length/(102410241024),4),‘G’) AS ‘Data Size’, CONCAT(ROUND(index_length/(102410241024),4),‘G’) AS ‘Index Size’, CONCAT(ROUND((data_length+index_length)/(102410241024),4),‘G’) AS’Total’FROM information_schema.TABLES WHERE table_schema LIKE ‘test’;

查看一个库中的情况

truncate table table_name;
发布了108 篇原创文章 · 获赞 0 · 访问量 2891

猜你喜欢

转载自blog.csdn.net/VIP099/article/details/104976931