The solution above did not work for me either. What worked though is if you have auto increment pk, mysql maps the rows in the order it keeps the indices, therefore so far only this approach worked for me