Home

Awesome

Deprecated . If you are using it, please consider migrating to node-mysql2

About

Mysql client module for node.js, written in JavaScript. No other mysql runtime required.

Build Status

Install

npm install mysql-native

Community

Check out the google group http://groups.google.com/group/node-mysql-native for questions/answers from users of the driver.

Example

<pre>var db = require("mysql-native").createTCPClient(); // localhost:3306 by default db.auto_prepare = true; function dump_rows(cmd) { cmd.addListener('row', function(r) { console.dir(r); } ); } db.auth("test", "testuser", "testpass"); dump_rows(db.query("select 1+1,2,3,'4',length('hello')")); dump_rows(db.execute("select 1+1,2,3,'4',length(?)", ["hello"])); db.close();</pre>

output is: row: [ 2, 2, 3, "4", 5] row: [ 2, 2, 3, "4", 5]

Highlights

#API

Module Functions

Client Functions

All commands fire 'end'() event at the end of command executing.

TODO

LINKS

MySql protocol documentation:

Other node.js mysql clients:

Bitdeli Badge