title: Module name "mysql" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded
body: <p>I am using Apache cordova tools in visual studio community. I am writing a hybrid app in Javascript. I encountered this error while setting connection to MySQL database:<br>
  Module name "mysql" has not been loaded yet for context: _. Use require([]) <a href="http://requirejs.org/docs/errors.html#notloaded" rel="nofollow">http://requirejs.org/docs/errors.html#notloaded</a></p>
  
  <p>My code is</p>
  
  <pre><code>var mysql = require('mysql');
  
              var connection =  mysql.createConnection({
                  host : "localhost",
                  user : "root",
                  password: "root"
              });
  
                  connection.connect();
  
                  connection.query("use verify");
                  var strQuery = "select * from table1";  
  
                  connection.query( strQuery, function(err, rows){
                      if(err) {
                          throw err;
                      }else{
                          console.log( rows );
                      }
                  });
  </code></pre>
  
  <p>Error pops up on the first line.
  I installed mysql using both </p>
  
  <pre><code>npm install mysql
  </code></pre>
  
  <p>and </p>
  
  <pre><code>npm install -g mysql
  </code></pre>
  
  <p>with usual command prompt and the one with node.js but the problem persists.
  I also copied mysql folder from nodejs to root folder of application but still problem persists.</p>