var mysql = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : 'tokki1127',
  port     : 3306,
  database : 'sample'
});

connection.connect();

connection.query('SELECT * from policy', function(err, rows, fields) {
  if (!err){
	  for(var i=0; i < rows.length; i++){
		  console.log(rows[i]);
		  console.log(rows[i].rank + " " + rows[i].keyword + " " + rows[i].num);
	  }
  }
  else
    console.log('Error while performing Query.', err);
});

connection.end();