sidorares/node-mysql2

:zap: fast mysqljs/mysql compatible mysql driver for node.js

TypeScript

4,388

4,056 commits

updated Oct 6, 2026

See the code

README

MySQL2

NPM Version NPM Downloads Node.js Version GitHub Workflow Status (with event) Codecov License

English | 简体中文 | Português (BR)

MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more.

Table of Contents

History and Why MySQL2

MySQL2 project is a continuation of MySQL-Native. Protocol parser code was rewritten from scratch and api changed to match popular Node MySQL. MySQL2 team is working together with Node MySQL team to factor out shared code and move it under mysqljs organization.

MySQL2 is mostly API compatible with Node MySQL and supports majority of features. MySQL2 also offers these additional features:

Installation

MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.

npm install --save mysql2

If you are using TypeScript, you will need to install @types/node.

npm install --save-dev @types/node

For TypeScript documentation and examples, see here.

Documentation

Acknowledgements

Contributing

Want to improve something in MySQL2? Please check Contributing.md for detailed instruction on how to get started.

To contribute in MySQL2 Documentation, please visit the Website Contributing Guidelines for detailed instruction on how to get started.

database-adapter
mysql
mysql-client
node-js

Significant stargazers

(top 24 of 26)

Trim21

238 followers · starred Feb 2023

Antonio Tripodi

221 followers · starred Mar 2026

Rob Scott

216 followers · starred Feb 2015

Yisi

2,419 followers · starred Dec 2024

sidorares/node-mysql2

:zap: fast mysqljs/mysql compatible mysql driver for node.js

TypeScript

4,388

4,056 commits

updated Oct 6, 2026

See the code

README

MySQL2

NPM Version NPM Downloads Node.js Version GitHub Workflow Status (with event) Codecov License

English | 简体中文 | Português (BR)

MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more.

Table of Contents

History and Why MySQL2

MySQL2 project is a continuation of MySQL-Native. Protocol parser code was rewritten from scratch and api changed to match popular Node MySQL. MySQL2 team is working together with Node MySQL team to factor out shared code and move it under mysqljs organization.

MySQL2 is mostly API compatible with Node MySQL and supports majority of features. MySQL2 also offers these additional features:

Installation

MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.

npm install --save mysql2

If you are using TypeScript, you will need to install @types/node.

npm install --save-dev @types/node

For TypeScript documentation and examples, see here.

Documentation

Acknowledgements

Contributing

Want to improve something in MySQL2? Please check Contributing.md for detailed instruction on how to get started.

To contribute in MySQL2 Documentation, please visit the Website Contributing Guidelines for detailed instruction on how to get started.

database-adapter
mysql
mysql-client
node-js

Significant stargazers

(top 24 of 26)

Trim21

238 followers · starred Feb 2023

Antonio Tripodi

221 followers · starred Mar 2026

Rob Scott

216 followers · starred Feb 2015

Yisi

2,419 followers · starred Dec 2024