Avinash Sinha Avinash Sinha - 2 years ago 104
SQL Question

How to install MySQL with Node.js & the node-mysql JavaScript Client

I am new on node.js and express.js, anyone please help me to get done it.

Answer Source

try this one

mkdir sp-node-mysql
cd sp-node-mysql
npm install mysql

and for connection as this

var mysql = require("mysql");

// First you need to create a connection to the db
var con = mysql.createConnection({
  host: "localhost",
  user: "jay",
  password: "jay"

    console.log('Error connecting to Db');
  console.log('Connection established');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download