code: function CreateConnection (backend, credentials) {
  
  
      backend.Debug (4, "MySQL creating connection [%s]", backend.uid);
      backend.base = mysql.createConnection(credentials);
  
      // 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') {
              console.log ("retry" + backend.uid)
              backend.Debug.call (backend,3, "MySQL connection lost [%s/%d] automatic connect retry in 10s]", backend.uid);
              setTimeout(function () {CreateConnection (backend, credentials);}, 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.call (backend,1, "MySQL connection fail [%s] automatic connect retry in 10s]", err);
              setTimeout(function () {CreateConnection (backend, credentials);}, MYSQL_RECONNECT_TIMER);
  
          } else {
              backend.Debug.call (backend,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