Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Asynchronous MySQL binding for Node.js
JavaScript C++ Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



Asynchronous MySQL binding for Node.js using libmysqlclient.
This module tested with Node.js versions 0.4.12 and 0.6.12 (stable), and else with 0.7.6.
Master (development) branch build status: Build status


This bindings provides all general connection/querying functions from MySQL C API, and part of prepared statements support. Connect, query and fetchAll are asynchronous.

I start this project in 2010 when Node.js is growing and Ryan had plans to write this binding as part of GSoC. Now it is used by many projects and have more than 10 contributors (listed below). I am also maintaining Node.js MySQL bindings benchmark that shows great performance of this module.

Node-mysql-libmysqlclient source code is available in the Github repo and you can place issues at the project tracker. Visit module site for API docs and examples. Also you can read some extra information in wiki.


To build this module you must install libmysqlclient library and development files for it.
mysql_config is used to determine the paths to the library and header files.
To install these dependencies, you can use the command shell.

For CentOS:

#> yum install mysql-devel

For openSUSE:

#> zypper install libmysqlclient-devel

For Debian/Ubuntu:

#> apt-get install libmysqlclient-dev

Yes, you would use aptitude if you want.

Please refer to your system documentation on oner systems and feel free to send me a patch for this readme.

Installation (for users)

You can install this module via NPM:

$> npm install mysql-libmysqlclient

Also you can build latest source code from repository, see below.

Build and use (for developers)

To get source code:

$> git clone git://
$> cd node-mysql-libmysqlclient

If you want to build specific version of node-mysql-libmysqlclient, checkout it:

$> git checkout v1.0.2

To build the binding using node-waf you should run:

$> make waf

To build the binding using node-gyp you should run:

$> make gyp

To cleanup:

$> make clean

To run tests:

$> make test

To lint code:

$> # install
$> make lint

The two files required to use these bindings are ./mysql-libmysqlclient.js and ./mysql_bindings.node (build/default/mysql_bindings.node). Put module directory in your NODE_PATH or copy those two files where you need them.


I will be happy to hear tips from the more experienced programmers. If you are interested in wide MySQL usage in Node.JS applications, leave your comments to the code. I'll be glad to see your forks and commits in them :)

To contribute any patches, simply fork this repository using GitHub and send a pull request to me. Thanks!

You can find other information about contributing and code style guide in wiki.


Full contributors list.


Node-mysql-libmysqlcleint is published under MIT license.
See license text in file LICENSE.

Something went wrong with that request. Please try again.