I have a MySQL column which got incorrectly loaded with data. I created a script which reads the text file of 14 million primary keys I know got messed up. I have a basic bash while loop but instead of issuing a separate mysql command for every id, I'd like to do it for a set of id's (I do have 14 million after all).
currently:
while IFS='' read -r id || [[ -n "$id" ]]; do
mysql -e "UPDATE my_table SET direct = 1 WHERE id = $id" -u $USER -p$PASS db
done < "$1"
what I would like to do is read in a set of id's and say something like WHERE id in ($#ids) without having to perform a bunch of loops and modulos. Ideas?
in ()clause.max_allowed_packetin mysql. any longer than that will be... not good.