fix the 'mysql server has gone away', which is because mysql connection is timeout after 8 hours of zero request received, so this submission implement the reconnection mechanism