
node-mysql2
:zap: fast mysqljs/mysql compatible mysql driver for node.js
The Lens
By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.
Updated Aug 2026
MySQL2 is the MySQL driver Node.js actually uses. It speaks the wire protocol in pure JavaScript, no compiled bindings, and adds what the original mysqljs library never shipped: real prepared statements, the binary protocol, compression, and a promise API. Free, MIT licensed, and one of the most-installed packages in the Node ecosystem.
There's nothing to operate. It's API-compatible with the old mysql package, so migration is usually a one-line change to your imports. Prepared statements aren't just safer against SQL injection, they're faster, because the server parses each query once.
Every Node app talking to MySQL or MariaDB should be on this, either directly or through an ORM that wraps it. Prisma, Drizzle, and Sequelize all ride on top. Use it directly when you want SQL without an abstraction tax.
The catch: it's a driver, nothing more. No migrations, no query builder, no failover logic beyond connection pooling. That's the point, but know what you're signing up for.
Free vs Self-Hosted vs Paid
fully freeFree tier: Everything. The package is MIT licensed with no commercial tier.
Self-hosted: Not applicable. It's an npm dependency.
Paid: Nothing. Your database hosting is the only bill in this stack.
Completely free and open source.
What to do by team size
- Solo
- free
- Small team
- free
- Medium team
- free
- Large team
- free
Get tools like this every Wednesday
One featured tool, three on the radar. No fluff.
A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores
Trust Signals
License: MIT License
Use freely, including commercial. Just keep the license.
Commercial use: ✓ Yes
About
- Owner
- Andrey Sidorov (User)
- Stars
- 4,385
- Forks
- 680
Explore Further
More tools in the directory
airbyte
The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
22.1k ★diesel
A safe, extensible ORM and Query Builder for Rust
14.2k ★panel
⚡ AcePanel - Enterprise server operation and maintenance management panel
3.0k ★