For detailed information about this and other Node.js database bindings visit the [Node.js DB homepage] homepage.
$ npm install db-mysql
var mysql = require('db-mysql');
new mysql.Database({
hostname: 'localhost',
user: 'root',
password: 'password',
database: 'node'
}).on('ready', function() {
this.query().select('*').from('users').execute(function(rows) {
console.log(rows.length + ' ROWS');
});
}).connect();
This module is released under the [MIT License] license.