npm install --save mysql
var mysql = require('mysql');
var con = mysql.createConnection({
host: 'localhost',
port: 3306,
user:'root',
password: 'password',
database: 'database_name'
});
con.connect();
var sql = 'INSERT INTO table_name(?, ?) VALUES(?, ?)';
con.query(sql, function(err, rows, fields){
if(err){
console.log(err);
}else{
console.log(rows.name);
}
});
truncate mollu;