title: how to get return data from mysql connection check callback function?
body: <p>I can not get return data from mysql connection check function at nodejs. Output is always false.</p>
  
  <pre><code>var dbcheck = false;
  
  connection.connect(function (err) {
      if(err) {
  
          dialog.showMessageBox(null,dbOptions, function (response) {
  
              if(response == 1){
                  shell.openExternal("https://innoscript.co");
                  app.quit();
              }
  
              if(response == 0){ app.quit(); }
          });
      }
  
      if(!err){
          dbcheck = true;
          return dbcheck;
      }
  
  });
  
  console.log(dbcheck);
  </code></pre>