或许可以用存储过程试试。每次更新1w条,执行264次。
create procedure updateLmData()
begin
declare i int;
set i = 0;
while i < 264
do
update lm_product_info set ess_onsale = 0 where ess_onsale is null order by id asc limit 10000;
set i = i + 1;
end while;
end;
call updateLmData;