Fixed bugs in mysql migration command and added method for inserting to mysql using given connection
(cherry picked from commit 1b5a3b9)