rule of thumb: delete 1000 rows at a time. check affected rows until zero. example: delete from `atable` where afield like '%something%' limit 0,1000;