I'm running a 'bash for' script to update some records in mysql, like so:
for i in `cat yahoo.txt`; do mysql $DB --batch -fe "update users set email=concat(left(email, instr(email, '@')), 'yahoo.com') where email like '%@$i';" ; done
but even with --force, the update stops after the first error:
ERROR 1062 (23000) at line 1: Duplicate entry '[email protected]' for key 3
Is there anyway I can force it to continue?
try changing update to update ignore
http://dev.mysql.com/doc/refman/5.0/en/update.html :