mysql2
Fast MySQL driver with native protocol implementation, prepared statements and SSL.
3. Used by agents' projects
Dependency in 41 public GitHub projects set up for AI coding agents that we scanned (0.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
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
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
Often used with
More about mysql2
Funding
- GitHub Sponsors: https://github.com/sidorares
- 4 GitHub sponsors
More in Databases, ORMs and clients
Alternatives
mysql2 This page
PostgreSQL client for Node.js with pure JavaScript and libpq API compatibility.
Fastest and simplest SQLite library for Node.js with synchronous API.
Modern high-performance Redis client for Node.js with full feature support.
Official Node.js driver for MongoDB providing query builders and connection management.
Asynchronous, non-blocking SQLite3 database bindings for Node.js.
Get started
Install it.
npm install mysql2No step-by-step start for mysql2 yet: we have not written its hand-checked card.