title: Connect Node with mysqli module?
body: <p>I want to connect Node JavaScript with Mysqli. I have downloaded the mysqli module using following command.</p>
  <pre><code>npm install mysqli
  </code></pre>
  <p>And Then Create JavaScript file with following code.</p>
  <pre><code>var Mysqli = require('mysqli');
  
  // incoming json 
  let  conn  = new Mysqli ( {  
        host: &quot;localhost&quot;,
        user: &quot;root&quot;,
       password: &quot;&quot;,
       database: &quot;ll&quot;
      } );
  
  conn.connect(function(err) {
    if (err) throw err;
    con.query(&quot;SELECT * FROM post&quot;, function (err, result) {
      if (err) throw err;
      console.log(result);
    });
  });
   
  </code></pre>
  <p>But not able to connect to database.</p>
  <p>I have used following Packages.</p>
  <p><a href="https://www.npmjs.com/package/mysqli" rel="nofollow noreferrer">https://www.npmjs.com/package/mysqli</a></p>