code: function (backend) {
  
      backend.Debug (4, "MySQL creating connection [%s]", backend.uid);
      backend.base = mysql.createConnection(backend.opts);
      backend.count ++;
        
      // register event for asynchronous server errors
      backend.base.on('error', function(err) {
          backend.Debug (1, "MySQL server error=[%s]", err);
          // Sever was restarted or network connection was lost let restart connection
          if(err.code === 'PROTOCOL_CONNECTION_LOST') {
               backend.Debug (4, "MySQL connection lost [%s/%d] automatic connect retry in 10s]", backend.uid, backend.count);
               setTimeout(function () {CreateConnection (backend);}, MYSQL_RECONNECT_TIMER);  
               
          } else { 
              throw err;  // server variable configures this)
          };
      });
      
      // force an initial connectiion at object construction time
      backend.base.connect (function(err) {
          if (err) {
               backend.Debug (4, "MySQL connection fail [%s/%d] automatic connect retry in 10s]", backend.uid, backend.count);
               setTimeout(function () {CreateConnection (backend);}, MYSQL_RECONNECT_TIMER);  
              
          } else {
              backend.Debug (5,"MySQL Connect Done [%s]",  backend.uid);
          }
      });
  }
docs: 10s timeout in bewteen two MYSQL reconnects ConnectDB is done on at creation time and asynchronously on PROTOCOL_CONNECTION_LOST