What is the best practice to update 2 million rows data in MySQL? As update by primary id, I have to update 1 by 1. It is so slow. Like below
UPDATE table SET col1=value1 WHERE id=1;
UPDATE table SET col1=value2 WHERE id=2;
UPDATE table SET col1=value3 WHERE id=3;
UPDATE table SET col1=valueN WHERE id=N;