如何优雅的查找磁盘上的MySQL表大小?
你好,谢谢邀请我回答。我是一名程序员,经常使用MYSQL。提供以下方法,希望对你有帮助。
1.查询所有数据库占用磁盘空间的SQL语句:
selectTABLE_SCHEMA,concat(truncate(sum(data_length)/1024/1024,2),MB)作为数据大小,concat(truncate(sum(index_length)/1024/1024,2),MB)作为索引大小frominformation_byTABLE_SCHEMAorderbydata_lengthdesc
2.查询单个库中所有表的磁盘占用大小的SQL语句:
selectTABLE_NAME,concat(truncate(data_length/1024/1024,2),MB)作为数据大小,concat(truncate(index_length/1024/1024,2),MB)作为索引大小frominformation_whereTABLE_SCHEMAtestdbgroupbyTABLE_NAMEorderbydata_lengthdesc
以上语句测试有效。请注意用数据库名替换上面的T
wireshark抓包分析密码怎么设置?
myisam_recover64K#GROUP_CONCAT()函数结果transaction_isolationrepeatable-readinnodb_file_per_table的最大允许长度。
