connect the mysql database by installing a library. here, picked the stable and easy to use node-mysql module.
npm install [email protected]
var http = require('http'),
mysql = require('mysql');
var sqlInfo = {
host: 'localhost',
user: 'root',
password: 'urpass',
database: 'dbname'
}
client = mysql.createConnection(sqlInfo);
client.connect();