1、配置中加上skip-new重启mysql,让innodb支持optimize
systemctl stop mysqld
systemctl start mysqld
2、optimize table miner_profit_detail_user
CREATE DEFINER=`root`@`%` PROCEDURE `optimize_table`()
BEGIN
declare table_count int default 50;
declare table_count_now int default 1;
set @strSql = "";
while table_count_now <= table_count do
#优化指定的表
set @strSql = concat("optimize table miner_profit_detail_user_",table_count_now," ;");
set table_count_now = table_count_now+1;
PREPARE stmt FROM @strSql;
EXECUTE stmt;
deallocate prepare stmt;
end while;
END