目录

工欲善其事

实践出真知

活跃标签: linux java mysql 待分类 js springboot win10 电路 vue macOS nginx esp32 windows git docker idea maven esp8266 python Arduino

存档:

X

[ MySql ] 查找大表和清理

查看整个库的大小

select concat(round(sum(data_length / 1024 / 1024), 2), 'MB') as data
from information_schema.tables
where table_schema = 'schemaName';

查看表的大小

select TABLE_NAME, concat(round(data_length / 1024 / 1024), 'MB') 'size'
from information_schema.tables
where table_schema = 'schemaName'
order by DATA_LENGTH desc

这里的单位是MB可以自己改,我这边是按照从大到小的顺序排列的。找到表后 可使用 truncatedelete 删除


标题:[ MySql ] 查找大表和清理
作者:llilei
地址:http://solo.llilei.work/articles/2023/09/26/1695695789285.html