Moved common mysql code to util/mysql