</>PackageGraphPackageGraph

mysql2

npmv3.24.4TypeScript

fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS

Safe to adopt

Yes — mysql2 scores well across adoption, maintenance, weight, supply chain, and licensing. 10.5M downloads per week and 3 known dependents. Last published 2 days ago. 50 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    10.5M downloads per week and 3 known dependents.

  • AMaintenance: grade A, Excellent.

    Last published 2 days ago. 50 releases in the last 2 years.

  • BWeight: grade B, Good.

    Pulls in 9 transitive packages, about 1.4 MB installed (at least — some of the tree is still being crawled).

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding mysql2 to a project.

7
Direct dependencies

Runtime packages this one declares itself.

9
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

1.4 MB
Install size

Unpacked size of this package plus its entire runtime tree.

2
Tree depth

Longest resolved dependency chain below this package.

Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.

Licenses in the dependency tree

Apache-2.0MIT

Every license you inherit by installing mysql2, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >= 8.0
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

mysql2 vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
mysql2this page10.5M3MIT2 days ago
toad-cache01MIT1 day ago
send127.6M3MIT1 day ago
axios106.5M4MIT1 day ago
follow-redirects91.6M2MIT1 day ago
next40.6M0MIT1 day ago

Dependencies

Declared by mysql2 v3.24.4. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (17)

@biomejs/biome ^2.5.7@ianvs/prettier-plugin-sort-imports ^4.7.1@pokujs/multi-suite ^1.0.2@rollup/plugin-commonjs ^29.0.3@rollup/plugin-json ^6.1.0@rollup/plugin-node-resolve ^16.0.3@types/node ^26.2.0assert-diff ^3.0.4benchmark ^2.1.4c8 ^12.0.0error-stack-parser ^2.1.4poku ^4.5.0portfinder ^1.0.38prettier ^3.9.6rollup ^4.62.4tsx ^4.23.11typescript ^7.0.2

Used by

Popular packages that depend on mysql2.

Relationship graph

Dependencies (left) and dependents (right) of mysql2.

Frequently installed together

Release history

50 releases in the last two years, typically about 0 days apart.

Recent versions of mysql2
VersionPublishedSizeLicense
3.24.4latest2 days ago615 KBMIT
3.24.4-canary.e5833be2 days ago615 KBMIT
3.24.4-canary.2387daf3 days ago615 KBMIT
3.24.4-canary.9178c823 days ago596 KBMIT
3.24.38 days ago594 KBMIT
3.24.3-canary.1281e1e10 days ago594 KBMIT
3.24.216 days ago594 KBMIT
3.24.2-canary.87579e116 days ago594 KBMIT
3.24.2-canary.1dcd8ef16 days ago594 KBMIT
3.24.2-canary.de5627216 days ago593 KBMIT
3.24.117 days ago593 KBMIT
3.24.1-canary.183e94717 days ago593 KBMIT
3.24.017 days ago591 KBMIT
3.23.5-canary.f3a60bc17 days ago591 KBMIT
3.23.5-canary.c86fe5a17 days ago589 KBMIT

Overview

mysql2 is an npm package that fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS. It is extremely widely used, with about 10.5M downloads per week and 3 known dependents in the graph. The latest version is 3.24.4, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (10.5M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • Large dependency tree (25 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use mysql2?

Yes — mysql2 scores well across adoption, maintenance, weight, supply chain, and licensing. 10.5M downloads per week and 3 known dependents. Last published 2 days ago. 50 releases in the last 2 years.

How do I install mysql2?

Run `npm install mysql2` to add mysql2 to your npm project.

How many dependencies does mysql2 have?

mysql2 declares 25 direct dependencies and pulls in 9 packages in total once its runtime tree is resolved totalling about 1.4 MB on disk.

What license is mysql2 released under?

mysql2 is distributed under the MIT license. Its dependency tree also includes: Apache-2.0, MIT.

How popular is mysql2?

mysql2 has approximately 10,545,301 downloads per week and 3 known dependent packages.

Is mysql2 still maintained?

The most recent release of mysql2 (v3.24.4) was published 2 days ago.

Does mysql2 run install scripts?

No. mysql2 does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.