MYSQL 碎片清理

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

统计碎片表:

#切换至mysql数据库。
select table_schema db,
       table_name,
       data_free,
       engine
  from information_schema.tables
 where table_schema not in('information_schema', 'mysql')
   and data_free> 0 ORDER BY data_free DESC ;

优化表:

OPTIMIZE TABLE `oc_xxx_news`

查看整理完成情况:

show processlist;

 

转载于:https://my.oschina.net/colin86/blog/2873792

你可能感兴趣的:(数据库,python)