Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

mysql2

Fast MySQL driver with native protocol implementation, prepared statements and SSL.

Databases, ORMs and clientsNPM

GitHubWebsite

1. License

License from npm.

github.com/sidorares/node-mysql2

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What mysql2 does

Fast MySQL driver with native protocol implementation, prepared statements and SSL.

mysql2 popularity

66 / 100
Gid Score, #621 overall
25.6M
downloads a week, npm
4,395
GitHub stars
41
agent projects use it
mysql2: downloads per weeknpm, mysql2 25,561,117
mysql2: GitHub starssidorares/node-mysql2 4,395

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How mysql2 is used

  • mysql2 is a dependency in 41 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.8% of the 4,867 JavaScript/TypeScript ones), #15 of 120 in databases, orms and clients.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 93; those are left out of every share on this page.
  • The most used alternative in our scan is pg (298 projects).
  • Projects that use it most often also use dotenv (56.1%), Express (41.5%), Zod (61.0%).

By coding agent

23 projects, 0.7%
17 projects, 0.6%
14 projects, 0.6%

Often used with

In 56.1% of its projects
In 41.5% of its projects
In 61.0% of its projects
In 29.3% of its projects
In 26.8% of its projects
In 26.8% of its projects
In 75.6% of its projects
In 24.4% of its projects

More about mysql2

Funding
  • GitHub Sponsors: https://github.com/sidorares
  • 4 GitHub sponsors

See all

More in Databases, ORMs and clients

Alternatives

mysql2 This page

MITGid 6625.6M/wk

pg

PostgreSQL client for Node.js with pure JavaScript and libpq API compatibility.

MITGid 81106M/wk

better-sqlite3

Fastest and simplest SQLite library for Node.js with synchronous API.

MITGid 7217.4M/wk

redis (JavaScript)

Modern high-performance Redis client for Node.js with full feature support.

MITGid 7322.3M/wk

MongoDB Node Driver

Official Node.js driver for MongoDB providing query builders and connection management.

Apache-2.0Gid 7122.7M/wk

sqlite3

Asynchronous, non-blocking SQLite3 database bindings for Node.js.

BSD-3-ClauseGid 582.9M/wk

Compare mysql2 with another tool

Get started

Install it.

npm install mysql2

No step-by-step start for mysql2 yet: we have not written its hand-checked card.