useinformation_schema
2、查询所有数据的大小
selectconcat(round(sum(data_length/1024/1024),2),’mb’)asdatafromtables
3、查看指定数据库的大小
比如说数据库apoyl
selectconcat(round(sum(data_length/1024/1024),2),’mb’)asdatafromtableswheretable_schema=’apoyl’;
4、查看指定数据库的表的大小
比如说数据库apoyl中apoyl_test表
selectconcat(round(sum(data_length/1024/1024),2),’mb’)asdatafromtableswheretable_schema=’apoyl’andtable_name=’apoyl_test’;
整完了,有兴趣的可以试哈哦!挺使用哈
网站找的,都是正解
如果觉得《mysql优化存储查询 如何查看MySQL占用的内存都用在哪了 – 数据库 – 前端 php mysql统计行数》对你有帮助,请点赞、收藏,并留下你的观点哦!