change mysql cursor, make it can save log to $HOME/log/mysql