Tools/sidorares/node-mysql2

node-mysql2

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

4.4k+1/wkemergingTypeScriptMIT Licensetrending

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 free

Free 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
Self-hosting ops:trivial

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Score
74/100 · B+
Adoption17/30
Maintenance25/25
Community7/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

Community discussions enabled

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